Howdy,
was wandering if could be possible to start from Contemplate to add more fields based on roles (other than the 2 default Teaser/Body), so to allow a top-down filter to content (as opposed to the bottom-up filter provided by other access-limiting modules as TAC, CAC, OG, simple acces,..), based on role of author.
Imagine to have:
- 3 roles (Silve, Gold, Platinum)
- a 'Listing' content-type composed of 12 fields
and you need to let authors fill in all the fields on submission form, but then show only some of them to the visitors on node output depending on role of the author, so for example Silver authors can show 4 fields, Gold can show 8 and Platinum all 12.
Does this make sense and would be somehow feasable adding more role-based templates?
thx
Comments
Comment #1
jjeff commentedI think that you can do this with the current module without any updates.
You would just write into your template something along these lines:
I'm going to mark this as "by design" but let me know if I'm missing something in your request.
Comment #2
jjeff commentedOoop... that would be the code for a node.tpl.php -type file... For contemplate you would use this:
-Jeff
Comment #3
marcoBauli commentedhumm...and this will filter by role of author (top-down), NOT role of user actually browsing the node (bottom-up), right? (sorry if i repeat myself, but this is the tricky bit..)
Comment #4
jjeff commentedThe global $user variable represents the user who is *viewing* the page. So the above example filters for the visiting user.
To filter based on the author's roles, you'd do this type of thing:
Comment #5
marcoBauli commentedJeff, you are the man!
ohh i was chasing such functionality since such long time...!
it works! Thank you! :D
PS: love the mod by the way. Maybe in a future it could turn into a Drupal *powertool* for theming nodes, similarly to what Category is for structuring or Views for publishing?!
Imagine adding:
well, maybe i'm just flying, but this would be nice indeed..
cheers
Comment #6
1kenthomas commentedhttp://drupal.org/project/cck_field_perms?