Create separate pages for different view modes for a given content type.
On the manage display page for a given content type, you can assign patterns for view modes so that they will become a page at the given path. For instance, if you want to show the teaser at a specific URL, you could do
node/%/teaser. If you also use Display Suite or other modules that allow you to create new view modes, you can use these modes to display one or more fields from a node at a separate URL.
This module also includes basic Features module integration. This allows you to selectively export your settings in a feature.
Restrictions: currently, the node path must be contained in the URL. This means view mode pages must follow the form
[node path/node alias]/[view mode url]. These pages are added via
hook_menu. Multiple wildcard characters can be used.
How to add a view mode page
- Create a content type
- Configure a view mode. If you are using Display Suite, or another means of adding view modes, you may need to add a new one.
- Go to the "manage display" tab for your content type.
- In the "View mode pages" tab, enter your URL pattern for the view mode page.
- Save the content type. You may also need to clear the Drupal cache, but the page should be available!
Initially, this module was going to display a single field from a node on a page. The view mode example is much more flexible as it allows for multi-field pages.
Additionally, if you are using something like Display Suite, you can add blocks from Views or other sources to your display allowing you to customize the view mode pages even more.
Entity Support (v2.0)
The original VMP module was written to support nodes. There is now a release that has added entity support. Please check the entity support issue for more information about changes to the API and functions provided by this module.
Recently added some API/hooks for this module that may allow for more control of the output of the view mode page. Also included some that tie into times when patterns are deleted/added. See the development version (may have to checkout from git).
On the configuration page you can add as many path patterns as you desire, path patterns are based on the regular entity url's/aliases.
For instance, if you want to show the teaser at a specific URL.
- Go to your drupal admin -> "Configuration" -> "Search and metadata" -> "Entity view mode path".
- Here you can add a path pattern like /%/summary and select the view_mode teaser.
- If you have a content page which regular entity url/alias is "/my/great/page".
- You can now visit "/my/great/page/summary" which will render the teaser of that page.
The module configuration is exportable like you would expect.
- Maintenance status: Actively maintained
- Development status: Under active development
- Module categories: Content, Path Management, Site Navigation
- Reported installs: 815 sites currently report using this module. View usage statistics.
- Downloads: 9,809
- Last modified: December 28, 2016
- Stable releases are covered by the security advisory policy.
Look for the shield icon below.