By suit4 on
In my user profile I use a custom field named field_country, which is actually a list of countries. (like descibed here: http://drupal.org/node/35728)
This field is part of the registration process.
Now I'd like to set up a view getting all nodes submitted by authors/users from the country they selected.
I think, that should be done with Views >> Arguments, but the custom profile fields are only available within Views >> Fields.
Next idea is using some custom code as Argument Handler Code, but code I but in there seems not to be executed.
Any ideas how to do something like this?
Thanks
Comments
track
track
Problem solved
Drupal is so cool!
This is simple!
The node type I use is custom cck, let's call it 'Project'.
Just add a new cck field to the 'project' node, the type should be 'computed'! (Yes, you need the module for cck computed fields! See http://drupal.org/project/computed_field)
Set the label to 'Country'.
In Data Settings set to 'Required' and put in
I'm not shure about the other settings,
I use
Display: yes
Store using the database settings below: yes
Data type: text
Data Length: 256
Default: Empty
Not NULL: yes
Sortable: yes
Now, you can go to the views and create a view with 'field_country' as argument, now it is present there.
Agreed. Drupal is tres cool.
Very helpful snippet. Cheers!
Here you need to do this for
Here you need to do this for every Custom Profile Field, right? Is there a way to have this done automatically, so for any custom field you create?