This section describes how the Html Part is used within the CMS in order to add blocks of HTML Code to each Content Type.
The Html part is used to inject custom HTML Code into pages of the same type, it is incorporated into the Content Type Template using handlebars code.
Tip
PageHTML vs HTML
The HTML part is used to enter HTML content at the content type level - this will be the same for every content item created using this type.
The PageHTML part is used to enter HTML content at the content item level - this can be different on every content item.
Content Type Settings
Multiple HTML parts can be added to each Content Type, each HTML part added allows for a snippet of HTML code to be entered, then positioned as required in the Content Type template.
For every HTML part added to the Content Type a corresponding HTML code editing window (as shown below) is added to the content type.
HTML code can be typed directly into the text area, this code is then inserted as raw HTML and displayed on all the pages of that type. Code entered into Html parts can use any shared/common CSS styling applied to the website (referenced by classes or ids), Additional CSS style blocks or inline CSS can also be used although this is not recommended.
Content Item Settings
There are no Content Item settings used for the HTML part.
Using the Part in Templates
Each Html part needs to be included within the Content Type Template in order for it to be added to the page.
This is achieved using handlebars tags, for example, if the Html part is named 'HTML' as per the screenshot above, the corresponding handlebars code would be {{{HTML.html}}}.
If the HTML part was called HTML1, the handlebars code required would become {{{HTML1.html}}}.