Hi,

Thanks for your work on this module! I'm coming from #1263118: Have equivalent of Node Reference URL Widget, and this looks like it's a great step towards finding a solution for using the Node Reference URL Widget module with entity references.

I'm still missing one feature however: the ability of adding node links onto referenced entities. This is one aspect which imo makes the node reference url widget module so handy and easy to use.

Example: on all possible parent nodes add a link "Add child entity", which points to the node create page for the child content type, with the reference field value filled in already (via a respective url parameter). The link text+title should be configurable. See also the highlighted part #3 in this screenshot.

Is that something that can be added to this module, or is there already any other recommended way of achieving this behavior?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

robydago’s picture

Maybe I'm not understanding your request correctly, but isn't something this module can do?:

References dialog

bforchhammer’s picture

Not exactly; it's actually kindof the other way around... instead of filling a "child references" field on a parent with new child pages, I want links on the parent page which allow to create new child pages referencing the parent.

Hm, maybe have a look at this mustardseedmedia podcast which explains the node links feature... Minutes 5' to ~7' are the relevant ones; the "Add Story" link is what I'm talking about.

amitaibu’s picture

I have added a CTools plugin under "Entity reference" that allows adding node create links. I'm still missing the "redirect" option.

bradyemerson’s picture

Amitaibu, is this plugin separate? I am not seeing a ctools plugin you speak of, would you mind providing more info?

Thanks for your hard work!

amitaibu’s picture

Are you using latest dev?

rwilson0429’s picture

I have accomplished this functionality using the Entity Reference module, Reference Dialog module and Entity Views Attach module.

mike27’s picture

Please, can you explain how you did that in steps?

Thank you

rwilson0429’s picture

Status: Closed (fixed) » Active

adding node links onto referenced entities

Example: on all possible parent nodes add a link "Add child entity", which points to the node create page for the child content type, with the reference field value filled in already (via a respective url parameter)

This can be accomplished with the References Dialog module, Entity Reference, Entity Views Attach and, the Entity Reference Prepopulate modules. Per the References Dialog project page,

This module extends reference fields like the user and node reference fields by adding links to add, edit and search for references through a dialog. This allows for a workflow where the user can create all the references to a node at the same time as she is creating it, a process which sometimes get's a bit backwards, when a user for instance needs to create all the facts for an article.

The functionality of this module very closely resembles that of the dialog in the Node Relationships module for Drupal 6, but it is written to be extendable so that support for more fields and entities can be created easily.

Step by Step: Adding and editing child nodes while viewing parent nodes and visa versa using referenced entities and views

You will need to create two content types. One will be the parent and the other will be the child in the reference relationship.

  1. Create the parent content type (i.e. gallery) with whatever fields you need. DO NOT create a reference to the child. That will be accomplished later.
  2. Create the child content type (i.e. images).
  3. Add a new field to the child content type of field type 'Entity Reference' and select autocomplete as the widget type.
  4. Save the newly added entity reference field.
  5. Configure this entity reference field and check the box to Enable Entity reference prepopulate. If the reference dialog module is enabled, it places an Edit dialog, Add dialog, and Search Dialog on the configuration page of the entity reference field. Select all the edit options you desire.
  6. Under the Target Bundle section, select your parent content type (i.e. gallery) as the target bundle.
  7. Save your settings
  8. Now create a View that is filtered by the the content type of the parent (i.e Content Type = Gallery).
  9. Entity Views Attach module adds a new Views display named Entity Content to Views 3. Add an 'Entity Content' View Display.
  10. Under the ENTITY CONTENT SETTINGS section of the Entity Content display, select the following:
  11. Entity type:Node
    Bundles: [select the parent bundle, i.e. Gallery]
    Arguments:id
    Show title:Yes (optional)

  12. Set the Contextual filter of the Entity Content View display to the parent content. For example, I've been using Gallery as the parent in this setup. So, my contextual filter will look like: 'content: Gallery'.

    edit: The contextual filter you select here should be the entity reference field in your child content that points to the bundles you select under the Entity Content Settings of the view.

  13. Under the FIELDS section of the Entity Content View display, select the fields from the child (i.e. image) that you want to display on the parent nodes.
  14. edit: To place a 'add' content link on the parent content type to create a child node. You will need to create a relationship of Entity Reference: [parent-content-type] on the Entity Content display created in step 10. Add the NID of the parent content type (we will use this to prepopulate the href tag using the entity reference prepopulate module) to the view in the Fields section and select to use the relationship that you created. You can exclude it from the display if you desire but, it is needed for its token value.

    In the View's footer section (or wherever you want the 'add link' to appear), create a global: Text Area and put the following link in there:
    <a href="/node/add/[your-child-content-type]?[your-reference-field-machine-name]=[nid]">add new [child-node]<a/>

    Once you save the view, you should see an 'add new [child-node]' displayed on your parent nodes.

    For convenience, I placed all of the View displays mentioned above into a single view. If this is an approach you want to try but, the instructions are too confusing, let me know and I'll give a shot at rewriting.

  15. Complete any other configuration options you want on the view then, save it.
  16. Now go to the parent content type and manage the display (admin/structure/types/manage/[your-parent-content-type]/display
  17. You should see a new field on the manage display page representing the Entity Content View display you previously created. If you do not see this field, flush your cache.

that's pretty much it. The above steps will place a 'add link' on the parent nodes to add a child node, and place a 'add link' on the child nodes which points to the node create page for the parent content type, with the reference field value filled in already (via a respective url parameter). Also, note that the Reference Dialog module also adds a new display to Views named Reference Dialog. You can use the Views Reference Dialog display type to apply additional filters to the references that are made available when viewing or editing your parent or child nodes. Once you setup a Reference Dialog display in Views, you'll see additional options on your content type configuration pages that uses the Reference Dialogs.

As you can tell, I have not mastered the art of writing good step by steps but, I hope this makes some sense and that it helps you get started in the right direction.

mike27’s picture

Thank you for your extensive reply. I 'll try it right away and let anyone know.

M.

UPDATE: "Add link" is not shown. Maybe I missed sth in the contexual filter? My settings are:
Content: Type
Provide default value: Content ID from URL
Specify validation criteria: Validator - Content | Content type - Parent| Filter value format - Node ID

I followed steps several times, but th link is not added. Is there any way to test it manually from url?

For example in Drupal 6 you could put (theme | test) "Add link" manually using the following format:
node/add/CHILD/Arg, where Arg is NID from referenced PARENT node

Thank you for your time,

M.

rwilson0429’s picture

@mike27, To place a 'add' content link on the parent content type to create a child node. You will need to create a relationship of Entity Reference: [parent-content-type] on the Entity Content display created in step 10.

Add the NID of the parent content type to the view in the Fields section and select to use the relationship that you created. You can exclude it from the display if you desire but, it is needed for its token value.

In the View's footer section (or wherever you want the 'add link' to appear), create a global: Text Area and put the following link in there:

<a href="/node/add/[your-child-content-type]?[your-reference-field-machine-name]=[nid]">add new [child-node]<a/>

Once you save the view, you should see an 'add new [child-node]' displayed on your parent nodes.

So, to summarize the steps outlined above, I had a parent content type named 'gallery' and a child content type named 'image'. On the image content type, I had a entity reference field named 'gallery'. On the 'gallery' field, I enabled entity prepopulate and configured the entity reference information. I then, created a view that contained a entity content display (see steps starting at 10 -15) to attach a view of related child nodes to parent. I creaded a Reference Dialog Search View display to place an 'add, edit and search dialog' on the child nodes that pointed to the parent content bundle. I added a relationship of Entity Reference: Referenced Entity (A bridge to the Content entity that is referenced via field_gallery) to the entity content display. I added the parent NID by using the relationship. I added a Global:Text area in the Footer section of the view and in the text area I put <a href="/node/add/image?field_gallery=[nid]">add new image<a/> and, checked the box to "Use replacement tokens from the first row".

For convenience, I placed all of the View displays mentioned above into a single view. If this is an approach you want to try but, the instructions are too confusing, let me know and I'll give a shot at rewriting.

bforchhammer’s picture

@rwilson0429: nice workaround, but creating a separate view for this seems a bit of an overkill, don't you think? ;-)

Amitaibu: I have added a CTools plugin under "Entity reference" that allows adding node create links. I'm still missing the "redirect" option.

From looking at the code, that module is a ctools "content_types" plugin which can be used with panels. Is it possible to somehow make it available for use without panels? (Maybe as a pseudo-field that is automatically added to the parent content type?)

rwilson0429’s picture

@mike27, yeah it was a bit much but, it worked ok for me. Your idea of making the er ctools pluggin that allow adding node create links available without requiring use of panels sounds like a good idea.

Ideally, the Entity Reference Prepopulate module would duplicate and expand on all the functionality of the Node Reference URL module. As bforchhammer stated in making the feature request, it seems that the only thing that is missing is giving users the option of choosing whether a link should appear on nodes that can be referenced. The feature of the Node Reference URL that allowed users to select to have a link appear on nodes that can be referenced, was a nice an very useful feature.

If this feature is added to the Entity Reference Prepopulate module, there would be no key functionality of the References module that users could not easily duplicate in the Entity Reference module. So, I'm hoping the maintainer will consider this feature request seriously and make it available through the UI.

I thank Amitaibu for creating this module so quickly. I need to start learning how to code so that I can be more of a help in these type of matters.

clashar’s picture

FileSize
15.23 KB

I agree that adding built-in functionality to ERPP would be very useful.
I attach screenshot of this option in Node Reference URL Widget.

clashar’s picture

rwilson0429,
I'm trying to follow your instructions and on step 11:
"Set the Contextual filter of the Entity Content View display to the parent content. For example, I've been using Gallery as the parent in this setup. So, my contextual filter will look like: 'content: Gallery'."

I can't find that filter, I can see for example "Content: Type ",
or "Content: Education (field_cv_edu) Appears in: node:cv."
where "field_cv_edu" is a field in "cv" content type

but can't find like 'content: cv'.

Could you please describe more detailed this step.

rwilson0429’s picture

@clashar,
In step 11, the contextual filter that you select shoud be the entity reference field in the child content that points to the parent content. So, set the Contextual Filter to your entity reference field. You can find it easily by typing the name of your reference field in the Contextual Filter search box.

If 'field_cv_edu' is your entity reference field in your cv content type, then, select that as your contextual filter.

kitikonti’s picture

i have tried #8 but dont work for me
so in the meantime, if this is a help for someone.
my workaround for the add link is a block which i only place on the node type of my parent nodes with the following content:

<?php
$node = menu_get_object(); //get parent node object
$link_txt = t('Product Request'); //set text for link and title attribute
print l($link_txt, 'node/add/produkt-request', array('attributes' => array('title' => $link_txt), 'query' => array('field_product_id_ref' => $node -> nid)));
?>

you have to place 'node/add/produkt-request' with 'node/add/[CONTENTTYPE-CHILD]'
and 'field_product_id_ref' with the name of your reference field.

clashar’s picture

rwilson0429,

thank you for explanation.

I tried several times to implement this, still got no success.

All I got now is the view entity displayed on parent node, but no "add" links on child or parent.

Seems I should try to do all from the start...

clashar’s picture

kitikonti, thank you for your code, I believe it could be only a temporary solution?

hazah’s picture

I too needed this functionality and could not find a solution that made me happy. It all just seems to heavy for the small problem that this is. So I cooked up a very small two function module to handle the case of nodes linking to nodes. It lacks configuration at the moment, so it works in an all or nothing fashion upon enabling. I am planning on adding in configuration to control which content types links are enabled. Take a look. See if this suits your needs in the meantime. I would not mind some constructive criticism as this is my very first module (Giggady).

I based the link injection code on the core book module, and the link assembly on the entityreference_prepopulate_create_node_links function. The current version assumes a ul. Since I do not know if I could have tampered with that I by passed it completely and assembled the links by making the same array that is assembled in the book module.

Some additional thoughts I have, and I don't know if I'm alone:

  1. Clean URLs by turning ?field_foo=# into /field_foo/# or even /foo/# (automated setting of the $_GET var or is this shunned upon? If it is, it's probably still worthwhile by doing this some other, proper way).
  2. Enabling links for other entities that have nodelike behaviour (i. e. have their own page view [like profile 2]).
hazah’s picture

I added the functionality that is mentioned in my previous post. I think it could be considered a complete module at this point.

Please let me know what you think.

clashar’s picture

hazah, thank you for providing the module.
I enabled it and went to entity ref. field settings, then I got this error:
Warning: Invalid argument supplied for foreach() in form_type_checkboxes_value() (line 2251 of Z:\home\paris11.kz\www\emploi\includes\form.inc).

I'm on localhost, so you wouldn't see paris11.kz domain.

But option: "Enable Entity reference prepopulate node links" is available and also content type choosing.
So I checked options and saved the field and no error appeared after.

clashar’s picture

otherwise your module seems to work)

mike27’s picture

I confirm that solution #8 works very well.
Thanks,
mike

hazah’s picture

Yes, I've had that happen to me to, at somepoint. I thought I had the issue corrected. I've made it into a contrib module (it's still in the sandbox because there's some coding style issues and it's on the main branch), but you can check it out, it should work without the error (also, I've changed the name because it was a little too clunky).

hazah’s picture

I've attached the version of the module that is currently waiting for review. It should install through the admin interface (at least, it did for me).

clashar’s picture

hazah, seems to works fine now.
whether it is possible to easily implement also "add" function?
I mean to add a node from previously created view, I see only "create" or "edit".

hazah’s picture

I'm not entierly clear on the question. Could you provide an example of what you mean? Just a brief description of the setup should do. Also, it's probably best to now post it as an issue on the project's page: http://drupal.org/sandbox/hazah/1488826 to keep things in one place. Sound good?

Edit: Do you mean have the links available when using a View? If so that is on my plate at the moment, as I need the same thing. Have a look at this issue #1490110: Views support, and let me know if this is the same request. I think it is.

clashar’s picture

@hazah,
sorry for not correct question in my comment #26.
I will write feature and support requests on your module's page

samtheory2718’s picture

Thank you hazah for your great work! I'm using the module you posted, and I can't wait until it becomes official!

I was wondering if anybody knew of a similar solution for links on taxonomy term pages, either to Term Reference fields or Entity Reference fields.

hazah’s picture

It's in the plans. Though I've never specifically mentioned taxonomy on my project page, I did mention entities. The current choice to do nodes mainly stems from the fact nodes are meant for content, so they are a rather special entity in this regard. I can definately see how catering to taxonomy would be beneficial. Especially with a complicated tree structure, where you would navigate to a child term to place content. I think you should open another issue on my project (I'm short on time now). Let this issue get closed as I don't think there will be a lot of focus on it from this project. Especially now that there is a working (unofficial) module :).

hazah’s picture

After further dubbing in code, I think this may yet be another module for this because taxonomy references are a completely different beast in the core. In some sense it makes sense to have a specialized field there because of its unique parent-child term relationships. So I feel that the best, and cleanest, approach would be to have a small prepopulate module dedicated to that field type, along with the same features. Perhaps, if the core adopts Entity Reference itself for its Term References, this duplication could be avoided. At the moment, my brain power isn't sophisticated enough to see a way out.

jaxpax’s picture

Hi!
I've been following this great thread, especially interested in having a "Add a node" link at the parent node. Everything works just fine with the Entity content view, showing child nodes together with the parent node.

But I have no luck in having the link <a href="/node/add/child?field_reference=[nid]">add new child<a/> triggering the child content type, prepopulated with the parent nid. It triggers the right content type but I have no luck in having [nid] catching any nodeID through the relationship of Entity Reference.

I am especially interested in this way of doing it, with the use of a link in the Global text in the header/footer area. My idea was to have a button: <form class="views-exposed-form" method="link" action="/node/add/child?field_reference=[nid]"><input class="form-submit" type="submit" value="Add a child node"></form>

I'm very interested in having this feature on my new site, but I don't feel like having to do implement it with the References module.

hazah’s picture

http://drupal.org/sandbox/hazah/1488826

Is this not doing it for you? I started that module for the explicit purpose of what you're describing.

jaxpax’s picture

Your excellent job does exactly what I want, with the use of a "add more ..." link. But what if I would want to use a <form> button instead of a text link? Could your module help me accomplish that?

hazah’s picture

I will gladly help. Can you explain more about your use case as an issue on that project's page?

jakobbebop’s picture

Hazah, I just git cloned your code -- it seems like you removed all the files from the master branch (only the README file remains; doing git checkout 93b258aa restores the actual module code, which I will proceed to try out later today :-)

Thanks! Jakob.

hazah’s picture

git checkout 7.x-1.x

Use that branch. The nice code checker told me to do that while I'm awaiting approval.

hazah’s picture

Status: Active » Closed (fixed)

Feel free to reopen, but I believe my new coming module resolves this issue. Cheers.

amitaibu’s picture

thanks hazah :)

Adam S’s picture

I was wondering if anybody knew of a similar solution for links on taxonomy term pages, either to Term Reference fields or Entity Reference fields.

I created a short tutorial how to implement Rules Link to function like the Nodereference URL Widget with any entity using a little bit of code taken from the latter module. Since the Node API is just a wrapper around the Entity API in Drupal 7 I don't understand why nodes are being forced. For every function in the Node API there is a similar function in the Entity API.

http://drupal.org/node/1376838

hazah’s picture

The choice to do nodes is because nodes represent content. Entities can represent anything. Also entity api isnt part of core.

Adam S’s picture

Also entity api isnt part of core.

This module is dependent on Entity API. There will be lots of cases where non node entities can benefit from this such as with users, profile2, media and other entities.

mobonobomo’s picture

I've been following this thread for a while, since this is functionality that I really need for a current project. "Create Prepopulate Node Links" is a great start, but I have multiple child content types, and the new project only shows one at this point. So, I went ahead and created an extensive tutorial that covers multiple child content types, displaying the related child content on the parent page, and adding "Add new (child content type)" links on the parent pages - with screenshots! The link is: http://drupal.arxic.com/node/28

hazah’s picture

cool. Thanks for that. I do appologize for thr slow progress on my part.

mobonobomo’s picture

No worries, I realized also that I may want to position my "Add new..." links in other places (easily) than the node links area. Eventually there will be several Flags in that area and I realized it might be a bit cluttered. In my example, I put the "Add new..." links in their own EVAs, but I have also now replicated them in blocks so that I can have them right at the top of on of the sidebars.

hazah’s picture

I was going for the least augmentation possible. My idea was that with views you can place links anywhere you want... or override the template, etc. Hence the choice.

WorldFallz’s picture

Though it really seems odd that this isn't included in the module, it's also easily doable with either the computed_field or token_field modules which I usually have installed already anyway. Adding a module or a view for just this one little function seems wasteful to me imo.

portulaca’s picture

I can confirm that the method from post #8 works! I didn't need References Dialog though just to have the "Add child of this parent" link. EVA is great!

But there's a bug in EVA you need to be aware of, once you create the EVA views display it doesn't automatically display on nodes. To make it appear you first have to visit the "Manage fields" page of the parent node type, only then you will see the views listed on the "Manage display" page.

clashar’s picture

If anybody have tested whether the method from #8 does work with i18?

rwilson0429’s picture

@WorldFallz: Would you share some details of your "easily doable" solutions mentioned int #47, plz?

WorldFallz’s picture

sure!

The simplest way is to use token_field to display the link (set it to <a href="/node/add/child?field_fieldname=[node:nid]&destination=node/[node:nid]">Add child</a>) and then use field_permissions to control display of the field.

A little more complex is to use a computed_field with the following for the 'Display code':

if (user_access('create child content')) {
  $display_output = '<a href="/node/add/child?field_fieldname=' . $entity->nid . '&destination=node/' . $entity->nid . '">Add child</a>';
}

Replacing 'child' with the machine name of the content type and 'fieldname' with the name of the entityreference field.

It can also be done in a preprocess function, template file, or with hook_node_view_alter-- there's really any number of ways to do it. Basically, any way you're comfortable with adding a link should work. The way nodereference_url did it was just really clean and dead simple.

rwilson0429’s picture

@ WorldFallz. Awesome man. Thanks so much.

clashar’s picture

WorldFallz, couls you please say how to use token_field with i18.

It works well for english, but if I try to include language prefixes like "fr", "ru", it doesn't work, I tried to include:
<a href="/fr/node/add/ja?field_appl_ref_jp=[node:nid]&destination=node/[node:nid]">Apply to this job

but field "field_appl_ref_jp" isn't filled.

WorldFallz’s picture

sorry clashar, I haven't used i18. It's not really an entityreference_prepopulate issue-- you might post to the i18n.

iRex’s picture

@WorldFallz - as regards your suggestions (which are simply brilliant, or brilliantly simple, btw) I would like to restrict access to the child link (e.g., "Apply Here" in the following way -

  • an authorised user can only click on the link once
  • the link is subsequently disabled for that particular user and
  • the (disabled) link text is changed to "You have already applied"
  • other authorised user can still see the "Apply Link", provided they have not previously clicked on that link

How can I do that?

Zombie777’s picture

Hello, just getting started in entity reference and I am having problems following the walk through. I don't get an attach to field settings group, just service field settings and entity selection and I don't get an option for node on target type. Am I missing modules? I have the latest download of the modules mentioned. However it is a bit frustrating when I need to do what is being shown but can't because something seems to be missing. I could really use this functionality, any ideas of what might be happening?

Yuri’s picture

@WorldFallz: you say "The simplest way is to use token_field to display the link (set it to <a href="/node/add/child?field_fieldname=[node:nid]&destination=node/[node:nid]">Add child</a>) and then use field_permissions to control display of the field."
Which indeed is quite obvious, but the next question is: how to create a view that lists all child content types of the viewed content type? Once we have that, the fields can be rewritten that way I guess.

WorldFallz’s picture

sorry yuri i have no clue what you mean-- i'm not sure what views has to do with this issue (which is about providing a link similar to what nodereference_url does).

Yuri’s picture

Yes you are right, this is about node links, not about a separate block (like organic groups has) sorry. I was looking for a way to put the prepopulate create links in a views pane(without having to install new modules). I'll post this as separate issue.

hazah’s picture

My module does this already. As I posted much earlier in this thread: http://drupal.org/sandbox/hazah/1488826

Yuri’s picture

@hazah: Thank you, great work! I do have problems getting your module to work in views, however. Can you assist me with that? (I posted a request on your project issues).

hazah’s picture

No problem :). Yes, I will try to get you going.

pennykara’s picture

I followed #8 by rwilson0429 which worked nicely (many thanks rwilson0429 for taking the time to document).
I found that I did not need the "References Dialog" module.

There was, though, a problem, if the view did not return any result (which happened when there were no child nodes for the parent node). My Global:Text Area in the footer set to: <a href="/node/add/child?field_reference=[nid]">add new child</a> was not applied to, even though I had the "Display even if the view has no results" option clicked. I placed some (arbitrary) text in the Global:Text Area and still I did not have any results.
I followed the instructions at #10 by rwilson0429 and add a relationship and a Title:nid field via the relationship, but still no "Add " content link will be displayed in the parent node, if there we no children. After spending a whole day experimenting I concluded that I needed neither the relationship nor the Title:nid field to provide the token [nid] (as suggested in #10), but:

SOLUTION

I went to the Advanced section of the view and in the NO RESULTS BEHAVIOR I placed some text in the Global: Text area. This forced the view, when there were no results, to look in the My Global:Text Area in the footer of the view, and hence I now always have an "Add" content link.

hosais’s picture

Status: Active » Closed (fixed)

sub

WorldFallz’s picture

@hosais -- besides the fact this issue is fixed and not likely to be updated, please use that nice big green button at the top of the page.

autopoietic’s picture

Issue summary: View changes
Status: Closed (fixed) » Needs review

creating additional views etc to achieve this seems a bit of a hack - @azuledu has created a sandbox module that simply allows the site maintainer to 'add node link' in the field>edit, which is then appears in the node actions:

https://drupal.org/comment/6462042#comment-6462042

works for me - could this not be added to the entity reference prepopulate module? It is quite a common usecase, similar to the book module's 'add child page' (which also uses appears in node actions)

WorldFallz’s picture

@azuledu has created a sandbox module

nope... that comment just links to hazah's module which is linked above right in this thread multiple times. it's really helpful if you take the time to read a thread before adding a comment.

amitaibu’s picture

Can someone update the issue summary, I'm pretty confused about what the issue is.

paulwdru’s picture

@amitaibu

Please look at Node Reference URL Widget and its Amazing Screencast , you'll know what the issue is.

In short, EntityReference Prepopulate is not as complete as Node Reference URL Widget which is really amazing easily streamlining the parent & child nodes relationship, providing 1-to-Many linking out of the box.

Also, the add-on Hazah http://drupal.org/sandbox/hazah/1488826 seems to have been abandoned nowhere.

paulwdru’s picture

Another amazing part of Node Reference URL Widget is it does provide a Returned Path setting, can be configured to automatically jump back to the Parent Node after creating a Child Node via the link provided and the alternative solutions mentioned above do not yet provide this feature

hazah’s picture

@paulwdru It's not abandoned per-se. Difficult to find the time with a day job :(.

senzaesclusiva’s picture

D 7.36
Entity Prepopulate (7.x-1.5+5-dev) and Prepopulate Create Node Links works well togheter for me.
At this point, the only thing that diffears from "node reference url widget" (for my main use) is the chance to customize "url text" as an alternative to the default "add new [type]"
Thx

le dendrite’s picture

this function is fundamental for me.
any chance i can get a update on the status of this?
thanks.

le dendrite’s picture

------please revise as updated issue summary as per request in comments. thanks ------

node types that can be referenced by another via a ER prepopulate field should have a link allowing so (create new node and fill ERP field(S)), from the node view.

example.
node of type-A (product) has a ERP field awaiting reference of a node of type-B (certificate), which has a similar field referencing node of type-A.... so viewing nodes of type-A should have a link to "create content' of type-B (certificate). which then autofills the ERP fields of both type-A and type-B. so the entities are married in a relationship....

kitikonti’s picture

@le dendrite
i think it would be better to use the relation module for a reference in both directions.

le dendrite’s picture

@ kitikonti thanks i'll try that.
i'm recreating a d6 site in d7 but using a lot of different modules. still figuring out all the changes and replacement modules and such after taking a lot of time off from all this...
thanks much for the reply. have good.

delacosta456’s picture

hi
if i am not wrong an alternative and simple possibility could be (after setting up everything related to entityreference prepopulate module) :

1- Install and enable the Command buttons Module
2- Install and enable the Token Module (if not already installed)
2- In your site at admin/structure/command-buttons create a button, and for the "URL" write :

node/add/(the content type you want to create machine name )?(the entity reference field machine name)=[current-page:url:unaliased:args]

the word in bracket mean that you have to replace it with it's mean and the alias at the end of the link don't have to be changed.

Note: don forget the question mark between the centent type machine name and the entity reference field machine name

Example of url : node/add/article?field_articleinfo=[current-page:url:unaliased:args]

FO’s picture

Hi,
In my case, using Link and Token Filter modules was a good solution to create a link to add new child content from the parent entity, with Entity Reference Prepopulate.
And to hide the field in the edit form, Field Extra Widget.

Anybody’s picture

Status: Needs review » Needs work

Zips are not accepted. Please create a proper merge request.