0

I have multiple values for a field in a node, and am displaying only the top 5 using CSS, however, I would like to display the full list of values on a separate page with a, 'View More' link to that page.

My initial reaction would be to create a views page, but how would I associate that view page with a specific node, and then how would I link to that views page from the original node?

The example:

  • The main node would be a content type for, 'Author'
  • Another content type that get's referenced from Author are, 'Publication'
  • The Author's node will display the top 5 Publications and then have a View More link to the full list of publication.

Is there any better way to accomplish this? All thoughts will be much appreciated.

0

Using Views would be the most common way to do this. I will show you a Display Suite method though.

Install these modules:

Display Suite (or any model that can give you extra view modes such as Entity view modes

Display Suite allows you to take full control over how your content is displayed using a drag and drop interface. Arrange your nodes, views, comments, user data etc. the way you want without having to work your way through dozens of template files. A predefined list of layouts (D7 only) is available for even more drag and drop fun!

View Mode Page

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.

Field multiple limit

This is a simple module that provides settings to limit the number of values to display on fields with multiple values.

Token

Provides additional tokens not supported by core (most notably fields), as well as a UI for browsing tokens.

Default View Mode:

On your content type's default view mode activate One Column Display Suite layout and click on the gear next to your multi value field and set it to show the first 5 of the multi value field. Use Display Suite to create a Code Field on entities node, with Field code:

<a href="[current-page:url]/more">Show all</a>.

Tick Token. Back on the manage display for the default view mode you will now see that field: Show all. Drag it to where you want it displayed

Show all View Mode:

Use Display Suite to create an additional View mode. Go to Manage display for the new View mode and set the 'View mode pages' URL pattern to node/%/all. Make sure you set the multi value field to show all values.

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.