0

It may be wishful dreaming, but it would be sweet if I could pull this off. I've been banging my head against it for a while now.

Has anyone done this before?

3 Answers 3

4

I actually did this on a project recently.

You can use Entity Reference Prepopulate. It's nice because you can make the field disabled if it's populated, all handled through the UI.

The alternative would be to just write a little bit of JS that disables the field on the node edit form if the value isn't empty.

1

I agree with @KyleTaylored. I've done this many times using Entity Reference Prepopulate but the url for pre-populating in that case is:

http://example.com/node/add/mynodetype?field_to_populate=11

4
  • Thanks, I was just looking around for how to use this thing. Why isn't there more usage info on drupal project pages??
    – doub1ejack
    Commented Mar 11, 2014 at 15:06
  • Well, there are no exact rules about what documentation should be provided by the module author for a module. A good tip is to always read the README.txt file in each module. Many times you will find info there that is not available on the project pages. Other good places are, in my opinion, Drupal documentation site, buildamodule.com, drupalize.me, Youtube, Packt publishing online book library, mustardseedmedia.com/podcast, nodeone.se/sv/learn-drupal and of course Drupal Answers. You kind of need to build up your own reference links/materials. BR / Fredrik
    – drupwell
    Commented Mar 11, 2014 at 16:07
  • Oh, and by the way, I understand your frustration but it's not a one way street so if you think that the documentation should be updated then why not write some documentation yourself and suggest it to the author or perhaps write an article and post in at Drupal.org for others to read. BR / F
    – drupwell
    Commented Mar 11, 2014 at 16:27
  • A very fair point. Just saw this simple, helpful post on the topic: drupal.stackexchange.com/questions/75874/… .
    – doub1ejack
    Commented Mar 12, 2014 at 15:12
0

Of course - 4 minutes after I post that I hit on the answer:

http://example.com/eform/submit/form-name?edit[field_entity_ref_name][und]=11

Now I need to figure out how to set this field as read-only and I'm golden.

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.