Class SectionHandlebarsHelper
- java.lang.Object
-
- com.terminalfour.publish.handlebars.helper.BaseHelper
-
- com.terminalfour.publish.handlebars.helper.section.SectionHandlebarsHelper
-
- All Implemented Interfaces:
com.github.jknack.handlebars.Helper<Object>
@Component public class SectionHandlebarsHelper extends BaseHelper
The {{section ...}} handlebars helper is a simply utility helper that outputs Section information, including from the Section Meta Content.Usage
The section handlebars helper is a simply utility helper that outputs Section information, including from the Section Meta Content.
Attributes
The section handlebars helper accepts a single attribute.
- field - The field to output. Possible values are below:
- id - Output the Section Id.
- name - Outputs the Section Name.
- ... - Attempts to find matching field in the Section Meta Content to output.
Example 1
{{section field="Name"}}
In the above example, the Section Name is output.
Example 2
{{section field="Description"}}
In the above example, the helper attempts to find a description field in the Section Meta Content. If it is found, its value is output.
-
-
Constructor Summary
Constructors Constructor Description SectionHandlebarsHelper(SectionIdHandlebarsHelper sectionIdHelper, SectionNameHandlebarsHelper sectionNameHelper, ISectionAPI sectionApi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
apply(Object context, com.github.jknack.handlebars.Options options)
Theapply
method is the main entry point for handlebars.java helpers.
-
-
-
Constructor Detail
-
SectionHandlebarsHelper
@Autowired public SectionHandlebarsHelper(SectionIdHandlebarsHelper sectionIdHelper, SectionNameHandlebarsHelper sectionNameHelper, ISectionAPI sectionApi)
-
-
Method Detail
-
apply
public Object 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.
-
-