0

I have a new node type where a user is asked who he or she knows from the site. They are to be presented with a select list with the names of the existing users on the site.

When creating this new select list field in Drupal 7, I noticed that the PHP snippet is gone so I cannot dynamically generate the select list text and values. Is there some Drupal way (Views?) to do this without having to download the CCK (development status) module for Drupal 7? The CCK module is not ready for prime time in Drupal 7. I understand that their rationale to remove PHP snippets are for security reasons (http://drupal.stackexchange.com/questions/2509/what-are-the-downsides-of-using-custom-php-code-in-blocks-nodes-views-args). The Drupal team would not leave us hanging without this common functionality, right?!??!

2

I think your best bet would be http://drupal.org/project/entityreference module and the entityreference_view_widget. PHP filter is still there in D7 but you have to enable it under modules.

  • I will check out the entity module and report back. Unfortunately just enabling PHP in Drupal 7 does not do the trick. From my research it seems like the Drupal team purposely left out the PHP snippets. I am okay with that, but there needs to be an alternative to this since I cannot imaging that they thought this was a not-needed feature. – user785179 Jan 17 '12 at 2:39
  • The entity reference is almost there, but it does not allow me to create the format I want. It is very basic. Any other ideas or suggestions? I am close to just using the incomplete and developer versioned CCK module for Drupal 7, but I have a feeling it will be a mistake down the line. – user785179 Jan 23 '12 at 17:24
1

Yes, just use Reference module, it has node_reference sub module within.

With node reference module on, you create views that lists out whatever selections can be avaliable to user. Then you add a new node refernce field for your content type. Select the view you created as option.

  • Interesting! Unfortunately the references module is being deprecated and they are telling users to use the entity reference module instead. drupal.org/project/references – user785179 Jan 17 '12 at 12:06
  • Oh, that's great, didn't realize it. I probably mean the same thing as 7wonders's answer. – gilzero Jan 17 '12 at 15:58
1

I went with the CCK module out of desperation. All seems to be working well since I have my PHP snippets back.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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