How to add the Add Link for new nodes?

You know I mean the link that's needed to create an new node, that is referenced to the parent one, like: node/id?reference_filed_name_of_referenced_node=[id]

I have figured out that there is a Page Manager integration some how, but at least for me it wont work.

To recreate what I have done:

  • Activate Page Manager and Panels
  • Go to admin/structure/pages/wizard and click on "Node Page Template"
  • Select the parent node typ, the one that has to have the add link
  • "Add content" to the panel, select "Entity Reference", "Content prepopulate links"

After saving I don't see as expected any link, but I get this message in the log:

Warning: Creating default object from empty value in panels_renderer_ipe->render_pane_content() (Zeile 145 von /srv/pub/drupal/sites/all/modules/panels/panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php).

Maybe this has something to do with my php version php 5.5

It is sad to see that there is no documentation page for this great module!

Comments

andros’s picture

I have things a little bit messedup in my first post. The correct format for the link is: node/add/NODETYPE?field_FIELDNAME=[NID]

Also the warning message comes from the panelizer module, which is showing this message every time a panel pane is has no actual content in it.

I have figured out that i have to edit the field with the reference once again and click from there on "FieldSettings" and save the form once again. Only after that the field was full functional and only after that I could add new nodes that are referenced and the "Add link" showed up!

I wonder why I have found nothing about the possability to use page manager to make this link available.

Page manager works at least for me to generate this link, only thing I miss is a setting to override the name of the Link.

I have also used page manger to make a view visible on the node page. The vie i have created is very simple but useful i think.

To summarize what I have done:

  • Make a view with a content pane as display type
  • Filter the the node type that has the actual referenced field in it
  • Add a Contextual filter and select the actual field which is the entity reference field "Content:Your_Fieldname"
  • Select for this field "Provide default value" -> "Content ID from URL" an Save the view
  • Make a Page Manger Node Template with the Wizard, for the node type which has to have the view in it
  • Add the view Pane to your new template with page manager

I think it would be really helpful if someone would write a documentation page for this module. :-)

HaloFX’s picture

So have you actually got this to work?

I have been searching for hours, and the most I have come up with is it can be done with Panels, somehow.

andros’s picture

Yes, you can find the prepopulate link in page manager. Have you worked with page manger before?
You can find some video documentation here:
https://drupal.org/node/1862908

Page Manager is really bad documented, but the module is actually very useful.
I Don't know if it is part of the documentation what i have done is just using the page manager template wizard in /admin/structure/pages/wizard

But I you could maybe also generate the link with a view.

HaloFX’s picture

Yeah, I am comfortable with Page Manager, but didn't see anything that looked like the prepopulate link.

andros’s picture

Yes. If I click on Add Content I see in "Entity reference" -> "Content prepopulate links"
Using version 7.x-1.3

andros’s picture

The feature that I would request is, make the Link Text customizable.