Class PublishHandlebarsHelper
- java.lang.Object
- 
- com.terminalfour.publish.handlebars.helper.BaseHelper
- 
- com.terminalfour.publish.handlebars.helper.content.element.PublishHandlebarsHelper
 
 
- 
- All Implemented Interfaces:
- com.github.jknack.handlebars.Helper<Object>
 
 @Component public class PublishHandlebarsHelper extends BaseHelper The {{publish ...}} handlebars helper is used to "publish" a Content Element.It should be noted that in many cases this helper outputs HTML code, so it should be surrounded with a triple-stash instead of the standard double-stash}}, when required. Content Elements that would be expected to contain T4 Tags in their output have those tags processed directly by this helper. These element types are HTML, Media and Section/Content Links. UsageAttributesThe expression itself is quite simple, taking only a single attribute. - element - The Content Element to be published
 Standard expression{{publish element="Content Element"}}The above handlebars expression is a standard expression that calls the publish helper. In this use scenario, the returned string is escaped. Triple-stashed expression{{{publish element="Content Element"}}}The above handlebars expression is a triple-stashed expression. Any HTML code returned by standard double-stashed is escaped. If you expect a helper to return HTML code, which you want embedded in the published page, this triple-stashed variant should be used. 
- 
- 
Constructor SummaryConstructors Constructor Description PublishHandlebarsHelper(IElementAPI elementApi)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringapply(Object context, com.github.jknack.handlebars.Options options)Theapplymethod is the main entry point for handlebars.java helpers.
 
- 
- 
- 
Constructor Detail- 
PublishHandlebarsHelper@Autowired public PublishHandlebarsHelper(IElementAPI elementApi) 
 
- 
 - 
Method Detail- 
applypublic String apply(Object context, com.github.jknack.handlebars.Options options) Description copied from class:BaseHelperTheapplymethod is the main entry point for handlebars.java helpers.It is called internally by the handlebars.java engine when a matching handlebars.java expression is encountered. - Specified by:
- applyin interface- com.github.jknack.handlebars.Helper<Object>
- Specified by:
- applyin class- BaseHelper
- Parameters:
- context- The currently executing context.
- options- The options.
- Returns:
- The generated output.
 
 
- 
 
-