Class EmbedHandlebarsHelper
- java.lang.Object
-
- com.terminalfour.publish.handlebars.helper.BaseHelper
-
- com.terminalfour.publish.handlebars.helper.content.layout.EmbedHandlebarsHelper
-
- All Implemented Interfaces:
com.github.jknack.handlebars.Helper<Object>
@Component public class EmbedHandlebarsHelper extends BaseHelper
The {{embed ...}} handlebars helper allows a developer to embed one Content Layout within another one.Usage
The {{embed ...}} handlebars helpers allows a developer to embed one Content Layout within the current one.
Attributes
The embed handlebars helper has one required attribute.
- layout - This tells the helper which layout to load.
Example
{{embed layout="text/description"}}
In the above example, the text/description belonging to the Content Type of the currently publishing Content Item is processed.
-
-
Constructor Summary
Constructors Constructor Description EmbedHandlebarsHelper(IContentLayoutAPI conentLayoutApi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CharSequence
apply(Object context, com.github.jknack.handlebars.Options options)
Theapply
method is the main entry point for handlebars.java helpers.
-
-
-
Constructor Detail
-
EmbedHandlebarsHelper
@Autowired public EmbedHandlebarsHelper(IContentLayoutAPI conentLayoutApi)
-
-
Method Detail
-
apply
public CharSequence apply(Object context, com.github.jknack.handlebars.Options options)
Description copied from class:BaseHelper
Theapply
method 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:
apply
in interfacecom.github.jknack.handlebars.Helper<Object>
- Specified by:
apply
in classBaseHelper
- Parameters:
context
- The currently executing context.options
- The options.- Returns:
- The generated output.
-
-