Implementation details
https://handlebars-test.proddev.terminalfour.net/terminalfour/page/section#edit/7793/contents## Page Layouts
| Name | Description of changes | Helpers used | Partials used | Edit |
| --- | --- | --- | --- | --- |
| Inner Page - Left Nav | There are a number of changes to note here. T4 Tags for _Navigation_ and _Media_ have been updated. In addition, some reusable blocks have been moved into a _Partial_. | [nav](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/navigation/NavHandlebarsHelper.html), [media](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/media/MediaHandlebarsHelper.html) | [standardMetaTags](#standardMetaTags) | [Edit](/terminalfour/page/pageLayout#edit/6) |
## Content Layouts
| Content Type | Content Layout | Description of changes | Helpers used | Edit |
| --- | --- | --- | --- | --- |
| General Content | text/html | The changes here are fairly standard, with T4 Tags replaced with their _Handlebars_ equivalent. Of note, is the _ifSet_ helper, which replaces a _selective-output_ T4 Tag. | [anchor](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/AnchorHandlebarsHelper.html), [ifSet](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/element/IfSetHandlebarsHelper.html), [publish](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/element/PublishHandlebarsHelper.html) | [Edit](/terminalfour/page/contenttype#edit/44/contentlayouts/115) |
| | text/sidebar | The changes to the _text/sidebar_ are similar to those in the _text/html_ _Layout_ for this _Content Type_. | [ifSet](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/element/IfSetHandlebarsHelper.html), [publish](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/element/PublishHandlebarsHelper.html) | [Edit](/terminalfour/page/contenttype#edit/44/contentlayouts/116) |
| Code | text/html | The changes to this _Layout_ are fairly standard, with T4 Tags replaced with their _Handlebars_ equivalents. | [tags](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/page/TagsHandlebarsHelper.html), [publish](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/element/PublishHandlebarsHelper.html) | [Edit](/terminalfour/page/contenttype#edit/43/contentlayouts/21) |
| Two Column Content | text/html | The changes here are fairly standard, with an optional header using the _ifSet_ _Handlebars Helper_ and other T4 Tags similarly replaced. | [ifSet](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/element/IfSetHandlebarsHelper.html), [publish](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/element/PublishHandlebarsHelper.html) | [Edit](/terminalfour/page/contenttype#edit/46/contentlayouts/118) |
| Two Column Video | text/html | This is similar to the _Two Column Content_ changes, with the addition of _ifSet_ blocks to check if video URLs have been set, before including them in the output. | [ifSet](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/element/IfSetHandlebarsHelper.html), [publish](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/element/PublishHandlebarsHelper.html) | [Edit](/terminalfour/page/contenttype#edit/45/contentlayouts/117) |
| Accordion item | text/item | The changes to this _Layout_ are fairly standard, with T4 Tags replaced with their _Handlebars_ equivalents. | [publish](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/element/PublishHandlebarsHelper.html) | [Edit](/terminalfour/page/contenttype#edit/68/contentlayouts/392) |
| Program Content Type (Basic) | text/course-json | There are significant changes to this _Layout_ are bigger. Firstly, it has been converted from a _Programmable Layout_ to a _Handlebars Layout_.
In addition to it's use of _Standard Helpers_, this _Layout_ also makes use of a _Custom Helper_ called _jString_. | [contentId](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/ContentIdHandlebarsHelper.html), [publish](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/element/PublishHandlebarsHelper.html), stripTags, [nav](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/navigation/NavHandlebarsHelper.html), [jString](#jString) | [Edit](/terminalfour/page/contenttype#edit/53/contentlayouts/10617) |
| Program Content Type (Advanced) | text/html | The changes in this _Layout_ are are similar to changes in other _Layouts_, in that T4 Tags have been replaced with the _Handlebars_ equivalents.
That said, this _Layout_ has a lot more fields than others that have been converted. | [publish](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/element/PublishHandlebarsHelper.html), [ifSet](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/element/IfSetHandlebarsHelper.html), [nav](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/navigation/NavHandlebarsHelper.html) | [Edit](/terminalfour/page/contenttype#edit/55/contentlayouts/306) |
| | text/course-json | The changes in this _Layout_ are very similar to those in the equivalent _Layout_ for the _Program Content Type (Basic)_ Content Type. | [contentId](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/ContentIdHandlebarsHelper.html), [publish](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/element/PublishHandlebarsHelper.html), stripTags, [nav](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/navigation/NavHandlebarsHelper.html), [jString](#jString) | [Edit](/terminalfour/page/contenttype#edit/55/contentlayouts/10616) |
| | text/list | The changes in this _Layout_ are again similar to those above. | [nav](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/navigation/NavHandlebarsHelper.html), [publish](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/element/PublishHandlebarsHelper.html) | [Edit](/terminalfour/page/contenttype#edit/55/contentlayouts/310) |
| | text/scripts | The changes to the final _Layout_ are minimal. The _Layout_ is used to output JavaScript in the published page. Only two T4 Tags have been updated to their _Handlebars_ equivalent. | [media](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/media/MediaHandlebarsHelper.html) | [Edit](/terminalfour/page/contenttype#edit/55/contentlayouts/309) |
| Events | text/calendar-json | | [publish](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/element/PublishHandlebarsHelper.html), [contentId](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/ContentIdHandlebarsHelper.html), [file](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/element/FileHandlebarsHelper.html), [recursDate](#recursDate), [startDate](#startDate), [adHocDates](#adHocDates), [extractLink](#extractLink), [fulltext](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/element/FulltextHandlebarsHelper.html), [endDate](#endDate), [jString](#jString), stripTags, [ifSet](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/element/IfSetHandlebarsHelper.html), | [Edit](/terminalfour/page/contenttype#edit/74/contentlayouts/3466) |
## Partials
The partials that have been added are all used within the _Inner Page - Left Nav_ _Page Layout_, as this is the only _Page Layout_ that has been updated to use _Handlebars_ for this demo.
| Partial Name | Description | Helpers Used | Edit |
| --- | --- | --- | --- |
| returnToTop | The _returnToTop_ Partial contains a single _Navigation Expression_ to return the User to the top of the page. | [nav](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/navigation/NavHandlebarsHelper.html) | [Edit](/terminalfour/page/content#edit/7776/10793) |
| conditionalStatements | Similar to the _returnToTop_ Partial, this one contains a single _Navigation Expression_ to output some conditional statements. | [nav](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/navigation/NavHandlebarsHelper.html) | [Edit](/terminalfour/page/content#edit/7776/10794) |
| standardMetaTags | The _standardMetaTags_ Partial is used to output _Meta Data_ about the current page.
This includes the Page title, which is different on _fulltext_ pages, including the _Title_ element from the _Content Item_, if it exists.
It also outputs a number of _Meta Tags_ to _fulltext_ pages only. Functionally this is equivalent to using the `_output_to_index="false"_` attribute within T4 Meta Tags, but instead uses the _fulltext_ Helper, which makes the code easier to read. | [sectionName](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/section/SectionNameHandlebarsHelper.html), [fulltext](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/element/FulltextHandlebarsHelper.html), [ifSet](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/element/IfSetHandlebarsHelper.html), [publish](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/content/element/PublishHandlebarsHelper.html), [nav](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/navigation/NavHandlebarsHelper.html), [meta](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/page/meta/MetaHandlebarsHelper.html) | [Edit](/terminalfour/page/content#edit/7776/10795) |
| linkToLevelTwo | The _linkToLevelTwo_ uses two _Navigation Expressions_ to create a link to level two within the overall Site Structure of the Channel. | [nav](/documentation/api-references/handlebars/com/terminalfour/publish/handlebars/helper/navigation/NavHandlebarsHelper.html) | [Edit](/terminalfour/page/content#edit/7776/10796) |
## Custom Helpers
The Custom Helpers that have been implemented for this demo relate mostly to the Event Calendar and other areas where the output format is especially important, both for String escaping and date formatting.
| Helper Name | Description | T4 Publish API Used | Edit |
| --- | --- | --- | --- |
| jString | The _jString_ function uses the Apache Commons API to escape a Java String | | [Edit](/terminalfour/page/content#edit/7777/10762) |
| jsonString | The _jsonString_ function uses the Apache Commons API to escape a String for use as a JSON String. | | [Edit](/terminalfour/page/content#edit/7777/10763) |
| xmlString | The _jsonString_ function uses the Apache Commons API to escape a String for use in XML. | | [Edit](/terminalfour/page/content#edit/7777/10764) |
| extractLink | The _extractLink_ function takes a full link as input (`[text](...)`), extracts value of the _href_ attribute and returns it. | | [Edit](/terminalfour/page/content#edit/7777/10765) |
| NewextractLinkText | The _extractLinkText_ function takes a full link as input (`[text](...)`), extracts text between the opening and closing tags and returns it. | | [Edit](/terminalfour/page/content#edit/7777/10905) |
| startDate | The _startDate_ Custom Helper uses the _IElementAPI_ to get the value of an Element within a _Content Item_. It formats the date, depending on whether the event last all day or not. It then returns the formatted date. | IElementAPI.isSet, IElementAPI.get | [Edit](/terminalfour/page/content#edit/7777/10766) |
| endDate | The _endDate_ Custom Helper uses the _IElementAPI_ to get the value of an Element within a _Content Item_. It formats the date, depending on whether the event last all day or not. It then returns the formatted date. | IElementAPI.isSet, IElementAPI.get | [Edit](/terminalfour/page/content#edit/7777/10767) |
| recursDate | The _recursDate_ Custom Helper is similar to the two above, formatting a date, if set. | IElementAPI.isSet, IElementAPI.get | [Edit](/terminalfour/page/content#edit/7777/10768) |
| adHocDates | The _adHocDates_ Custom Helper is similar to the other Date related Helpers above.
The main point of difference is that the _adHocDates_ Helper works on multiple _Content Elements_ instead of just one, and returns the values therein as a stringified representation of a JSON array. | IElementAPI.isSet, IElementAPI.get | [Edit](/terminalfour/page/content#edit/7777/10769) |
| NewoutputSelected | The _outputSelected_ Custom Helper allows a shorthand to output the selected items from a list.
It accepts three parameters:
1. The list you want to output (required)
2. Whether you want to output the list name or value (optional - default is name)
3. A custom separator output between each selected list item (optional - default is ", ") | | [Edit](/terminalfour/page/content#edit/7777/10863) |
| NewselectedContains | The _selectedContains_ Helper allows you to check whether the selected items in a list include a given string.
It accepts three parameters:
1. The list element (required)
2. The string you want to compare (required)
3. Whether you want to check the list "name" or "value" (optional - defaults to "name") | | [Edit](/terminalfour/page/content#edit/7777/10864) |
| NewcreateVideoEmbed | The _createVideoEmbed_ Helper creates an iframe from a given YouTube or Vimeo URL. | | [Edit](/terminalfour/page/content#edit/7777/10853) |
UG Quicklinks
Quicklinks
PG Quicklinks