Class AnchorHandlebarsHelper

  • All Implemented Interfaces:
    com.github.jknack.handlebars.Helper<Object>

    @Component
    public class AnchorHandlebarsHelper
    extends BaseHelper
    The {{anchor}} handlebars helper outputs a HTML anchor for the currently publishing content item.

    If there is no currently publishing content item, this helper outputs a blank string.

    Usage

    {{anchor}}

    The {{anchor}} handlebars expression is a simple tag that outputs a HTML anchor to the currently publishing content item. It does not contain any configurable attributes.

    • Constructor Detail

      • AnchorHandlebarsHelper

        @Autowired
        public AnchorHandlebarsHelper​(IContentAPI contentApi)
    • Method Detail

      • apply

        public CharSequence 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.