Node Subpages

Installs: 
151
Open Bugs: 
10
Development Status: 
Seeking co-maintainer(s)
Maintenance fixes only

This module allows site admins to define subpages for content types. For each content type, you can define what subpages will be used for nodes of that type, and what should be displayed for each subpage. The subpages can display the contents of a CCK field on the node, or a View.

Use Case

The module was originally developed for use on the Drug Policy Alliance website. Some content types have specific subpages that will be in use for almost every node of that type. For example, Issue pages have subpages like Our Priorities, Resources, and Activist Toolkit (see an example here). These subpages are common across Issue nodes, and it would be unwieldy to create another three nodes for those subpages for every Issue node.

Other content types have different subpages. For example, states have subpages like Laws, Campaigns, Resources, etc. See New York for an example.

Usage

After enabling the module, visit the Subpages tab for any content type. For the Page content type, for example, this will be found at admin/structure/types/manage/page/subpages (on Drupal 6, this would be /admin/content/node-type/page/subpages).

Click the "Add another subpage" link to define a subpage.

  • The Subpath field will be used as the path for the subpage. For example, if you define a subpath of "laws", then the Laws subpage for node 41 would be available at /node/41/laws. This is also true for the alias of the node. If node 41 is normally found at /state/new-york, then the Laws subpage would be /state/new-york/laws.
  • The Tab Title is used as the link text for the subpage in the tab bar.
  • Choose a data source. Either a Field or a View should be chosen.

Place the tab bar on the page using the Node Subpages Menu Bar block, which will be available on the Drupal Blocks administration page. When placed on a node page, this displays links for each subpage for that node.

The module includes some basic CSS to style the tabs. To override this tab styling in your theme, add a node_subpages.css file to your theme, and then define it in your .info file:

stylesheets[all][] = node_subpages.css

Misc. Notes on Functionality

  • Subpages that use Fields will not be available on nodes that do not have content for that Field. The link will not be displayed in the "Node Subpages Menu Bar" block, and visiting the path will result in an "Access denied" error.
  • Subpages that use a View will always be visible. This may change in the future, but it seemed like overkill to process the view to determine if it had any content on every page where the Node Subpages Menu Bar block is shown.
  • You will probably want to hide any Field that is used as a subpage. On the Display Fields tab for the content type, set such fields to display "<Hidden>" or check the Exclude box. Otherwise, the field will have its own subpage, but will also be displayed on the regular node view page.
  • Integration with Context is available, so that the subpages can be used as conditions.

Versions

  • 6.x-1.x: Fairly well tested. No more new features or new versions will be released; bug fixes only.
  • 7.x-1.x: Upgrade of 6.x-1.x. Also fairly well tested, also not going to get any new features; bug fixes only.
  • 7.x-2.x: Requires CTools. All new development will be done against this branch. Any existing installs of this module can and should be updated to this version once there is a stable release. Until then, we could use some more eyes on it to flush out any bugs, so give it a try!

Maintenance

As of December 23, 2012, I'm marking this module as seeking a co-maintainer, and getting maintenance fixes only. I don't have any clients using this module any more and no longer have time to keep working on it like I once did.

Sponsorship

Initial development of this module was sponsored by Jackson River and the Drug Policy Alliance.

Jackson River's mission is to support and strengthen non-profits, socially responsible businesses, cause-based initiatives, and progressive foundations by enhancing the effectiveness of their mission, people, process, and technology.

The Drug Policy Alliance (DPA) is the nation's leading organization promoting alternatives to current drug policy that are grounded in science, compassion, health and human rights.

Releases: 
7.x-2.1
6.x-1.0-beta2
7.x-2.x-dev
6.x-1.x-dev
Release Dates: 
06/05/2013
01/15/2012
10/01/2013
10/01/2013