CERN Accelerating science

Close menu

How to render Full Content display as on Home website

 

Basics

In previous articles and documentations we already explained how to re-use theming components as patterns as well as how to replicate the views of the home website. On this article we will explain step by step how to render your custom node page as on Home website. 

 

The process is similar to the aforementioned articles since the node pages renders of the home website is also accomplished using components, hence patterns. The patterns are encapsulated inside the CERN Components module and all you have to do is enable the module and map your fields with the ones of the pattern.

 

Example

Lets take as an example the case of News in the home website. The following screenshot shows how a news page is rendered:

Example of a news page on home website
Example of a news page on home website

 

For our example lets assume that you have created a content type called News Piece

 

  1. Enable the CERN Components module. In this way you enable the patterns in order to be used as display modes.

  2. Visit the Manage Display page of the News piece content type. At the bottom of the page enable the Full Content display mode if it’s not already enabled. By convention Drupal will render the node pages using this display mode. After enabling it click on “Save configuration” and you will notice that an extra tab appeared at the top of the page for the Full Content field configuration.Enabling the "Full Content" display mode

  3. Visit the Full Content display mode and scroll again down at the bottom of the page. Now you have to choose which pattern you will use to render the node pages. In this example we chose to render the pages like the News one so choose "News Full Content" and click on “Save Configuration”. For a complete list of the page node patterns, consult the CERN Components documentation. Choose News full content screenshot

  4. On this step you should map the Content Type fields with the pattern fields. In order to find which content field renders as which pattern field, consult the CERN Component documentation.

  5. Done. Now the News piece pages will render as on home website.