Class FilesizeHandlebarsHelper
- java.lang.Object
-
- com.terminalfour.publish.handlebars.helper.BaseHelper
-
- com.terminalfour.publish.handlebars.helper.content.element.FilesizeHandlebarsHelper
-
- All Implemented Interfaces:
com.github.jknack.handlebars.Helper<Object>
@Component public class FilesizeHandlebarsHelper extends BaseHelper
The {{filesize element="Content Element"}} handlebars helper outputs the size of the element with the provided name.Usage
{{filesize element="Content Element"}}
The filesize handlebars expression is a simple tag that outputs the size of the referenced Content Element. In the case of text elements, it outputs the length of the text returned by the publish method. For other elements the size is determined directly by calling the getSize() method on the referenced Content Element.
-
-
Constructor Summary
Constructors Constructor Description FilesizeHandlebarsHelper(IElementAPI elementApi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Long
apply(Object context, com.github.jknack.handlebars.Options options)
Theapply
method is the main entry point for handlebars.java helpers.
-
-
-
Constructor Detail
-
FilesizeHandlebarsHelper
@Autowired public FilesizeHandlebarsHelper(IElementAPI elementApi)
-
-
Method Detail
-
apply
public Long 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.
-
-