Class NavHandlebarsHelper
- java.lang.Object
-
- com.terminalfour.publish.handlebars.helper.BaseHelper
-
- com.terminalfour.publish.handlebars.helper.navigation.NavHandlebarsHelper
-
- All Implemented Interfaces:
com.github.jknack.handlebars.Helper<Object>
@Component public class NavHandlebarsHelper extends BaseHelper
The {{nav ...}} handlebars helper should be used to process Navigation Objects.Usage
The {{nav ...}} handlebars helper is a simple helper to allow Navigation Objects to be processed as part of a published page.
Attributes
- id - The id attribute is required and must be set to the id of the Navigation Object to be processed.
Example
{{nav id="321"}}
In the above example, the Navigation Object with id 321 should be processed.
-
-
Constructor Summary
Constructors Constructor Description NavHandlebarsHelper(INavigationAPI navigationApi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CharSequence
apply(Object context, com.github.jknack.handlebars.Options options)
Theapply
method is the main entry point for handlebars.java helpers.
-
-
-
Constructor Detail
-
NavHandlebarsHelper
@Autowired public NavHandlebarsHelper(INavigationAPI navigationApi)
-
-
Method Detail
-
apply
public CharSequence apply(Object context, com.github.jknack.handlebars.Options options) throws IOException
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.
- Throws:
IOException
- If processing of the expressions fails.
-
-