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.
I found myself needing to display User profile panel variants based on whether user has a profile node of a specific type - or not. I wrote a panels access plugin that allows this to be done.
The patch is attached below.
Comment | File | Size | Author |
---|---|---|---|
#1 | 1218452-panels-access.patch | 2.41 KB | cafuego |
panels-access-handler-profile-exists.patch | 2.88 KB | cafuego |
Comments
Comment #1
cafuego CreditAttribution: cafuego commentedRan into some interesting issues. Updated patch with lighter API call attached.
If you want to display the content profile node form in a Panel, you will need to make sure the drupal_goto() call in content_profile_nodeapi() will not run. Preparing the node form in the Panel context triggers the nodeapi('prepare') hook and causes non-admin users to be redirected to the profile node edit page instead of the Panel.
A very quick hack-around to make this work on the user profile panel template is to replace:
with
on line 376 of content_profile.module.