Good to know
For your better understanding, make sure to first read the documentation of CERN Components module
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.
Lets take as an example the case of News in the home website. The following screenshot shows how a news page is rendered:
For our example lets assume that you have created a content type called News Piece
Enable the CERN Components module. In this way you enable the patterns in order to be used as display modes.
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.
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.
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.
Done. Now the News piece pages will render as on home website.