Implementation details

NAV IS OUTPUT

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, media standardMetaTags Edit

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, ifSet, publish Edit
  text/sidebar The changes to the text/sidebar are similar to those in the text/html Layout for this Content Type. ifSet, publish Edit
Code text/html The changes to this Layout are fairly standard, with T4 Tags replaced with their Handlebars equivalents. tags, publish Edit
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, publish Edit
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, publish Edit
Accordion item text/item The changes to this Layout are fairly standard, with T4 Tags replaced with their Handlebars equivalents. publish Edit
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, publish, stripTags, nav, jString Edit
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, ifSet, nav Edit
  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, publish, stripTags, nav, jString Edit
  text/list The changes in this Layout are again similar to those above. nav, publish Edit
  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 Edit
Events text/calendar-json   publish, contentId, file, recursDate, startDate, adHocDates, extractLink, fulltext, endDate, jString, stripTags, ifSet, Edit

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 Edit
conditionalStatements Similar to the returnToTop Partial, this one contains a single Navigation Expression to output some conditional statements. nav Edit
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, fulltext, ifSet, publish, nav, meta Edit
linkToLevelTwo The linkToLevelTwo uses two Navigation Expressions to create a link to level two within the overall Site Structure of the Channel. nav Edit

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
jsonString The jsonString function uses the Apache Commons API to escape a String for use as a JSON String.   Edit
xmlString The jsonString function uses the Apache Commons API to escape a String for use in XML.   Edit
extractLink The extractLink function takes a full link as input (<a href="...">text</a>), extracts value of the href attribute and returns it.   Edit
NewextractLinkText The extractLinkText function takes a full link as input (<a href="...">text</a>), extracts text between the opening and closing <a> tags and returns it.   Edit
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
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
recursDate The recursDate Custom Helper is similar to the two above, formatting a date, if set. IElementAPI.isSet, IElementAPI.get Edit
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
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
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
NewcreateVideoEmbed

The createVideoEmbed Helper creates an iframe from a given YouTube or Vimeo URL.

  Edit