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:

  1. Set up new View at admin/structure/views and create a Block display of Format Fields and leave the default at Content: Title
  2. Under Relationships add:
    • OG membership: OG membership from Content group (no need to require relationship)
  3. 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
  4. Under Pager select Display a specified number of items
    • Set 1 item to display
    • Set 0 as Offset
  5. Under Fields select the Content:Title field
    • Select Group node from OG membership
  6. 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: