1

I'm in the process of planning a Drupal 7 site-build that will make use of what we're calling 'sub-pages' or 'minisites.' Essentially, as you can see in the wireframe below, we'll have a page for each Doctor, and each doctor page will have a sub-nav.

Subpage Wireframe


Here are some requirements;

  1. This sub-nav will link to pages with the url structure 'doctors/[doctor-name]/[sub-page-title]'.
  2. Sub-pages like 'Biography' are populated via fields on the node.
  3. Sub-pages like 'News' and 'Case Studies' are populated via contextual Views (based on references from these content types).
  4. Sub-pages like 'Community' are completely custom and unique to each doctor. Another doctor may have a 'Family' sub-page instead.
  5. The header above the sub-page should stay the same on every sub-page.
  6. Content managers should be able to easily add additional custom sub-pages.
  7. The site is being built utilizing the Panels suite (Panels Everywhere included).

What's the best way to accomplish this? I've fielded suggestions like 'use the Book module', but I wanted to get some feedback from the larger community before I start down a path that leads to a "90% solution."

Update (Includes my solution)

I've decided to pursue the Organic Groups route, as OG and its suite of modules have value in other areas of the site's architecture. In order to meet my requirements I've had to introduce a few additional modules (benefits included);

  • OG Menu
    • Configured to automatically create a menu for each 'Doctor' (an organic group).
  • OG Menu: Default Links (Submodule)
    • Configured to provide default menu links to views standard for any Doctor. When a Doctor is created, they'll automatically have menu links like 'News' and 'Case Studies'.
  • Rules
    • When my content managers create a new Doctor Page (organic group content to the Doctor Group), I made a custom rule that adds a menu link entry to the referred group menu (provided by OG Menu).
  • Sub-pathauto
    • We want URLS that are aliased to match the pattern 'doctors/[doctor-name]/[doctor-page-title]'. This modules lets me do that easily (doctor/[node:og_group_ref]/[node:title]).
  • OG Role Override
    • I need all content managers to edit and assign content to all Doctor groups. This module lets me do that easily.
  • Panels
    • General layout, but also overriding layout for Doctor Pages and default links that direct to views.

All-in-all, I have exactly what I need and didn't write a line of code.

Update Nov 16

This feature was sent out to pasture. Sad Panda. :`(

2

Everything you've described is done by OG (Organic Groups).

OG is originally designed for GROUPS to have 'private' sections of a website, or to manage how groups manage different parts of a website, but the side effect of that allows you to build highly contextual "sub sections" of a website just like you're describing.

All of the 'contextual' stuff you mention. Site side branding, sub section branding, site wide menus, section based menus. Are covered by OG.

Good luck!

  • Thanks alphex! Steve Purkiss advocated for this on Twitter as well (twitter.com/stevepurkiss/status/791652984971296769). – Aaron Silber Oct 27 '16 at 14:53
  • I've worked on a prototype using OG and here are some thoughts thus far (for viewers in the future); - I've installed OG Menus (dogo.to/og_menu) and the default links submodule. This allows me to add default links to new groups (to views), but it doesn't seem to validate against empty view pages. Thinking I can patch this. - I'd like new organic group content to be added automatically to the referenced group's ogmenu. I don't have this setup yet, but it would be ideal since end users will be able to reorder sub-nav easily via the UI. – Aaron Silber Oct 28 '16 at 15:06
2

For Drupal 7 and 8, and alternative to Organic Groups is the Group module. https://www.drupal.org/project/group Here is a blog post about the benefits of Group over OG: https://www.deeson.co.uk/labs/group-alternative-organic-groups

As suggested in comments to this post: here is a link to questions about group module: https://drupal.stackexchange.com/questions/tagged/group

  • Fully agree that this would be a valid (evn better?) alternative! Maybe you also want to add a link to these questions around here (ie all questions tagged with the group tag)? – Pierre.Vriens Oct 29 '16 at 6:29
  • 1
    Merci for taking my advice. Maybe you also want to extend your answer by explaining, for each of the 7 requirements (bullets) in the question how the Group module eventually helps to address (implement) them? – Pierre.Vriens Oct 29 '16 at 8:25
1

Depends a bit on your desired workflow and complexity. If you only need this might be simpler to just have another content type that has a entity reference (ie field_parent) to the doctor's page. Then a hook menu alter to add it to the submenu/a auto path seeingwith tokens to generate a sensible path. OG may do it better but may also add more overhead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.