Hiding fields when using print field[0]['view']

shanizar - March 7, 2008 - 10:09
Project:CCK Field Permissions
Version:5.x-1.10
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

When I use php to display fields to handle layout in a phptemplate file, fields are shown regardless of permission settings.
What value must I use to check if I'm supposed to print the field or not?

#1

picofaradpjf - June 13, 2008 - 16:15

Cck_field_permissions modifies $node->content, which is an array of field groups, which has and array of the fields in a group.
Inside the field array is [#access] and it seems CCK_field_permissions sets this to 1 or null based on the access rules for CCK_field_perms. With the devel module do a dpm($node->content) and you should see what I mean.

So basically you have to add a check of $node->content[field group][field][#access] to the contemplate.

#2

SocialNicheGuru - July 21, 2008 - 17:08

subscribing...

how can I have the fields hidden on the mode input screen.
I see where the access check is done in content template, but I do not know how to change the input screen so it is not seen.

 
 

Drupal is a registered trademark of Dries Buytaert.