My family history site has entity references to content that is marked private, living family-members for example can only be viewed by authenticated users.
When I display the family group, some of whom are alive, some of whom are dead, then the group looks incomplete to visitor without permission to view private content.
Is it not possible to display "Private content" instead of a blank field?

Appreciate any help!

Mike Sandes

http://sandesancestry.net

Comments

kerasai’s picture

@mike_san, this is really more of an issue with the behavior of the entity reference field, not the Private module. The Private module only allows you to set access control on the content, but the field is responsible for rendering the field values and by default it's respecting the access that's been defined.

I think your best bet would be to find or make a field formatter that handles the entity reference as you desire. Be careful handling access to your content, as you only want to reveal a bit of info about it and not give away the data of the entire node. In your case you'll likely still want to do some access checks, i.e. an unpublished node should not be listed vs. a private node which should be listed but not in the manner as a non-private node.

mike_san’s picture

Thanks for your advice, kerasai. The problem is that the field formatter has to point to a content type that could be private or public (and may even change at some point). Thanks anyway!

adamps’s picture

Status: Active » Closed (outdated)

Seems to be complete