Creating a view that displays the group's name on group's content pages
Last updated on
18 May 2024
Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites
To display the group's name on the respective group content pages follow these steps:
- Set up new View at admin/structure/views and create a Block display of Format Fields and leave the default at Content: Title
- Under Relationships add:
- OG membership: OG membership from Content group (no need to require relationship)
- Under Contextual Fiters add:
- OG membership: Group ID - select OG membership from node group for relationship
- When filter is not available - Provide default value () and select Current OG group from context
- OG membership: Group ID - select OG membership from node group for relationship
- Under Pager select Display a specified number of items
- Set 1 item to display
- Set 0 as Offset
- Under Fields select the Content:Title field
- Select Group node from OG membership
- Save your view and go to your blocks page and place the block where you would like it to display on the OG group content pages.
What this does is display the OG Group's name for the content title and loads according to the page the group belongs to. Won't display on non-group pages.
Help improve this page
Page status: No known problems
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion