Class 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 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
        The apply 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 interface com.github.jknack.handlebars.Helper<Object>
        Specified by:
        apply in class BaseHelper
        Parameters:
        context - The currently executing context.
        options - The options.
        Returns:
        The generated output.