0

I have a product display node and I'm trying to add a rental form to the node so that anyone can submit a rental form and have that reference the node. I was thinking of making the rental form a new Content Type so that the author information is automatically stored. I was also looking at Entityforms and specifically Inline EntityForms since that seems to incorporate the entityreference field.

Approach 1

What's interesting about the Inline Entityform is that you don't need an Entityform type to use it. You can select the Target type as 'node' and have that create a node form within the parent node's edit page.

The problem I'm facing with this approach is that you can't render the form on the front-end. I've tried setting the Display settings to 'Rendered entity' and I'm still not seeing anything on the front-end of the parent node, logged in as admin.

Is the Inline Entityform module only for embedding node add forms to the back-end?

Approach 2

The second approach was using Inline Entityform to target a node of type 'Rental' with the same settings but I was still unable to produce a node add form on the parent node front-end.

I do not want to use Panels but it's looking like I might have to? Any thoughts are appreciated.

2 Answers 2

0

Inline EntityForm is for placing an entity's form within an Edit page of an existing Node, eg (/node/edit/123). It's not for showing a form on a Nodes' page with a view_mode set to like full.

You want to use either:

And then either use Display Suite or alter the Node Template for your theme to include form for reservations when people view your Node.

Alternatively you can just use 2 content types: 1 for product and 1 for reservations. and use the Prepopulate module to build a link to create a Reservation -- which you can place on the product node. Clicking this link would send the user to create a reservation, you could always send them back to the product node using $form['#redirect'] on your reservation type.

And if you were crazy you could try to make a url using Prepopulate that loads an Ajax popup node reservation form on the product page.

Hopefully one of these ideas sets you on your path.

0

You might be slightly off-course with inline entityform. If you can get it going all power to you.

I am thinking of your problem in the following terms:

  • You have a content type "property page" and you have a number of nodes of that content type each representing a different property that's available to rent.
  • User's can browse the available properties and when they find the one they like they can press a 'Rent Me' or 'Apply' button.
  • This takes them to a form with the fields pertaining to the particular property that they came from already filled out, such as 'Greenview village, apartment 2'. From here they can fill in the form with their own data and submit the form.

If I have something wrong, do let me know and I'll adjust my answer. In the meantime:

I'd have a look at this tutorial first: "Creating a simple contact form per content item with entityform"

This method passes arguments through the url, which can get messy if you are trying to pre-populate multiple fields. Enter the 'Entity Reference Autofill' module.

The Entity reference autofill module gives Entity reference fields an option to populate other form fields with data from selected referenced entities.

Finally if your site-users have already logged in you can populate pertinent fields in the form with their data using the 'Field Default Token' module.

From your Comment I see that you are trying to embed the entityform on a node, iN which case have a look at this tutorial: "embedding an entiyform on a node" - be sure to 'update' the 'rendered entity' display option in the 'manage display' tab even if you make no changes...

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.