Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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?
Comments
Comment #1
picofaradpjf CreditAttribution: picofaradpjf commentedCck_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.
Comment #2
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedsubscribing...
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.