Class ContentIdHandlebarsHelper
- java.lang.Object
-
- com.terminalfour.publish.handlebars.helper.BaseHelper
-
- com.terminalfour.publish.handlebars.helper.content.ContentIdHandlebarsHelper
-
- All Implemented Interfaces:
com.github.jknack.handlebars.Helper<Object>
@Component public class ContentIdHandlebarsHelper extends BaseHelper
The {{contentId}} handlebars helper outputs the Id of the currently publishing content item.If there is no currently publishing content item, this helper outputs a blank string.
Usage
{{contentId}}
The {{contentId}} handlebars expression is a simple tag that outputs the Id of the currently publishing content item. It does not contain any configurable attributes.
-
-
Constructor Summary
Constructors Constructor Description ContentIdHandlebarsHelper(IContentAPI contentApi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Integer
apply(Object context, com.github.jknack.handlebars.Options options)
Theapply
method is the main entry point for handlebars.java helpers.
-
-
-
Constructor Detail
-
ContentIdHandlebarsHelper
@Autowired public ContentIdHandlebarsHelper(IContentAPI contentApi)
-
-
Method Detail
-
apply
public Integer 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.
-
-