Version:
Cohesiondx.com

    Creating view modes

    Drupal view modes are used to display different views of content. For example, the Full view mode is typically used to display the content in full on its own page whereas the Teaser view mode is used to display a short version of content within lists.

    Drupal provides a number of default view modes including:

    • Full content - Typically used to display content in full on its own page
    • Teaser - Typically used to display content in short form on lists.
    • Search index - Used to display content as part of a website search result
    • RSS - Used to define which content is provided through an RSS feed.

    Creating new view modes

    To create a new view mode:

    Step 1 - Create a new view mode

    1. Navigate to Structure > Display modes > View modes > Add new view mode
    2. Click on the type of content you want to make a view mode for. Choose Content for Content types.
    3. Give your View mode a short but descriptive name. You will use this name later to identify the View mode when you create a template for it.

    Create-view-mode.png

    Once you've saved your new View mode it will appear in the list of View modes under Structure > Display modes > View modes

    New-view-mode.png

    Step 3 - Select the fields you want to display in your view mode

    Once you have created your new View mode you can select which fields it should display.

    For the purpose of an example, the following steps are for managing the fields your new View mode will display on the Article content type. The same process applies for all other content entity types.

    To manage the fields:

    1. Navigate to Structure > Content types > Article > Manage display. You will see a number of View modes at the top of the page. These probably include Default, RSS and Teaser. Your new view mode will not be there so you need to add it. 
    2. Scroll to the bottom of the screen and click and open the Custom display settings expandable area
    3. Click the checkbox next to the name of your new view mode
    4. Click Save

    Enable-view-mode.png

    Once you've enabled the View mode within Manage display, you can select which fields it will use:

    1. The page will refresh and your view mode will appear at the top as an option
    2. Click on your view mode to show the fields it includes
    3. Select the fields you want to include and those you want to exclude:
      1. Drag fields you want to include into the active area (Top of list)
      2. Drag fields you want to exclude into the disabled area (Bottom of list).
    4. The fields you place in the active area will be available to your templates for that view mode
    5. Click Save.

    Configure-view-mode-fields.png

     

    Cohesion DX8 Help center

    Launch our Help center to raise a support ticket or search our knowledge base of common questions and answers.

    DX8 knowledge base icon

    Knowledge base

    Get instant answers to common questions. Available online 24/7.

    Find answers

    Raise a ticket icon

    Raise a support ticket

    Log in to the Help center to raise an issue. Available Monday - Friday, 09:00 - 17:00 GMT.

    Raise ticket