Class 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.

    • Method Detail

      • apply

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