Hi,
On a site I am working on I have a field on the user profile that users complete when registering that can have one or more values entered.. Lets says its a "favourite colours"..
I now want to create a content type that users can create that uses those entries to present a selection to the user (drop down, multi-select, etc.).. So in other words for the "favourite colours" field on the new content creation page they only have the choices of the colours they have saved in their profile in the "favourite colours" field..
Hopefully that makes sense.. :)
Anyone have any idea how to do it?
TIA
On 28 October 2011 16:51, Ted ted-drupalists@webfirst.com wrote:
Simple approach: You could use PHP to retrieve the allowed values from the current user's profile. Place that PHP code in the allowed values field of the content type.
If the user changes her favorite colors and then edits an existing node, it may cause loss of data (if that node had a color that was removed from their favorites, and hence is no longer a valid selection). You'll have to decide what to do in that and similar corner cases.
Ted
Thanks Ted..
Let me look into that and see what I find..
Couldn't you do some sort of Content Profile and Node Reference link? Could have a Content Type Color and then link to it as a selection. If you need more controls, you can add them as needed, like Node Reference Create, etc.
Joel
From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Wipe_Out Sent: Friday, October 28, 2011 12:18 PM To: support@drupal.org Subject: Re: [support] Input field based on user field data?
On 28 October 2011 16:51, Ted ted-drupalists@webfirst.com wrote:
Simple approach: You could use PHP to retrieve the allowed values from the current user's profile. Place that PHP code in the allowed values field of the content type.
If the user changes her favorite colors and then edits an existing node, it may cause loss of data (if that node had a color that was removed from their favorites, and hence is no longer a valid selection). You'll have to decide what to do in that and similar corner cases.
Ted
Thanks Ted..
Let me look into that and see what I find..
Simple approach: You could use PHP to retrieve the allowed values from the current user's profile. Place that PHP code in the allowed values field of the content type.
If the user changes her favorite colors and then edits an existing node, it may cause loss of data (if that node had a color that was removed from their favorites, and hence is no longer a valid selection). You'll have to decide what to do in that and similar corner cases.
Ted
The PHP option doesn't seem to be available in D7 unless I am missing something.. :(
Might need to look at a more complex option being the "relation" module..
On 31 October 2011 13:57, Ted ted-drupalists@webfirst.com wrote:
On 10/30/2011 6:00 AM, Wipe_Out wrote:
Simple approach: You could use PHP to retrieve the allowed values from the current user's profile. Place that PHP code in the allowed values field of the content type.
The PHP option doesn't seem to be available in D7 unless I am missing something.. :(
You need to install the CCK module for d7.
Interesting.. I thought that the core fields functionality was CCK from
D6.. :)
Will have a look..