I don't see any instructions identifying the URL format that is expected by the node add/edit form.

AKA, after I add an entityreference prepopulate setting to an existing entity reference field.. how do I construct it's add/edit URLs in order to prepopulate the field?

Comments

mariacha1’s picture

Check out the README.txt file in the module. It explains more. Would it be out of line to request Amitaibu add that to the front page of this module? Just a quick "For documentation, see the README.txt"? Might save some other users a bit of time.

Anyway, here's the readme's text for the 7.x-1.3 version, answering the question posted:

Description
===========
Allows the contents of an "Entity Reference" field to be pre-populated by
taking a parameter from the URL path.

Install
=======
1. Download and enable the module.
2. Visit admin/structure/types/manage/[ENTITY-TYPE]/fields/[FIELD-NAME]
3. Enable "Entity reference prepopulate" under the instance settings.

Configuration
=============
Enable Entity reference prepopulate:
Check this to enable Entity reference prepopulate on this field.
Action
Using the select box choose the action to take if the entity reference
field is pre-populated.
Fallback behaviour
Select what to do if the URL path does NOT contain a parameter to
pre-populate the field.
Skip access permission
This is a fallback overide, the fallback behaviour will not be followed
for users with the specified permission.

Usage
=====
In order to pre-populate an entity reference field you have to supply the
paramater in the URL.

The structure is
node/add/article?[field_ref]=[id]

Where [field_ref] is the name of the entity reference field and [id] is
the id of the entity being referenced.

Examples:
node/add/article?field_foo=1
node/add/page?field_bar=1,2,3

Stomper’s picture

How do I go about adding a "create content" link to content type A that creates a node of content type B that references A? Is this the correct module for this functionality?

How is this module different to Node Reference URL Widget?

Thanks

olak’s picture

assign a entity reference field on content type B that references A
create a view with a block display, showing only 1 item.
filter to content type A
use field:
nid (hidden, no link to content)
then put a custom text field with something like:
Link
put an nid contexual filter, with a hide view if there is no nid.

put the block on your desired region, and make it visible only to content B.
voila!

steinmb’s picture

Issue summary: View changes
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.