Skip to content

Content modeling for views

Views is a powerful tool for building dynamic content displays. Considering content modeling from a views perspective early in the process helps you ensure you can build dynamic content displays.

Plan how content will be reused

Views can pull and display content from multiple content types and fields and display them in an array of formats and styles. As you design your content model to be modular and reusable, consider the different ways information will need to be reused, or if you will need separate fields for specific uses.

For example, let's consider a wine tours site.

  • A layout section on the home page with a block listing "Featured Tours"
  • A page listing all tours, filterable by region or category.
  • A region-specific landing page showcasing tours within a particular area.

But what about the details of these displays? Will 1 media image field suffice, to be resized with responsive image styles? Or is more editorial control required for high-impact displays like a featured tour on the home page? You may want a one media image field for the hero image with precise dimension requirements, and another one which can be used for search result thumbnails or other listing displays. Yet another field may be desired for social media cards.

Consider both the displays, the information to be contained within, and the design requirements as you consider how content will be reused when you build views.

Structure data for flexibility

You can build flexible content displays by leveraging filter and sort criteria in Views. Think about how your content fields will be used to filter or sort the listings.

For example:

  • If you want visitors to be able to sort tours by price, you should store the price as a numeric field rather than plain text.
  • To create a feature where site visitors can filter tours by region, regions should be a taxonomy term rather than a text field.

Category-type fields are great candidates for filter criteria. To use them, you'll want to create taxonomy vocabularies populated with terms, and then add reference fields to the relevant content type.

For example, create a Wine regions taxonomy vocabulary and add terms for each region. Then add a Wine regions field on the Wine tours content type as a reference to the Wine regions taxonomy. Then you will be able to build a content display using Views that a user can filter by wine region.

Use references between content

References allow Views to connect different content types, such as linking testimonials to wine tours or showing wineries associated with a region.

For example:

  • A "Winery directory" page can use a view that pulls from the winery content type and filters by a wine region taxonomy term.
  • Testimonials can include a reference to the related wine tour, enabling a view that displays testimonials specific to a given tour.

Views-driven scenarios

Scenario 1: Wine tours listing page

  • Content model decisions:

    • Content type: Wine tour
    • Fields: Title, Featured image, Price, Duration, Region (taxonomy term), Tour category (taxonomy term)
  • View configuration:

    • Filters: Published status, Region (exposed), Category (exposed).
    • Display: Grid of tours, sorted by title or price.

Scenario 2: Region landing page

  • Content model decisions:

    • Taxonomy: Wine region
    • Related Content: Wineries (content type) and Wine tours (content type).
  • View configuration:

    • Contextual filter: Wine region term.
    • Displays:
      • Section 1: Wineries in the region (list of Winery content type).
      • Section 2: Tours in the region (grid of Wine Tour content type).
  • Content Model Decisions:

    • Field: "Featured" checkbox field in Wine tour content type.
  • View Configuration:

    • Filter: "Featured" field is checked.
    • Display: List of tours with title and image, displayed in a homepage block.

Additional resources