Class PageURLHandlebarsHelper
- java.lang.Object
-
- com.terminalfour.publish.handlebars.helper.BaseHelper
-
- com.terminalfour.publish.handlebars.helper.url.PageURLHandlebarsHelper
-
- All Implemented Interfaces:
com.github.jknack.handlebars.Helper<Object>
@Component public class PageURLHandlebarsHelper extends BaseHelper
The {{pageURL}} handlebars helper is used to output the URL of the page being previewed or published.Usage
The pageURL handlebars helper is used to output the URL of the page being previewed or published.
This means that during preview, the current browser URL will be output. However, during publish the URL will be the URL at which the page will be available when publishing is complete.
Example
{{#preview}} <div class="t4-info"> <span class="t4-channel">This is a preview of {{channelName}}</span> <span class="t4-publish-url">Page URL<br />{{pageURL}}</span> </div> {{/preview}}In the above example, if we're previewing the page, the Channel Name and Page URL are published in a div element.
-
-
Constructor Summary
Constructors Constructor Description PageURLHandlebarsHelper(IPageAPI pageApi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringapply(Object context, com.github.jknack.handlebars.Options options)Theapplymethod is the main entry point for handlebars.java helpers.
-
-
-
Constructor Detail
-
PageURLHandlebarsHelper
@Autowired public PageURLHandlebarsHelper(IPageAPI pageApi)
-
-
Method Detail
-
apply
public String apply(Object context, com.github.jknack.handlebars.Options options)
Description copied from class:BaseHelperTheapplymethod 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:
applyin interfacecom.github.jknack.handlebars.Helper<Object>- Specified by:
applyin classBaseHelper- Parameters:
context- The currently executing context.options- The options.- Returns:
- The generated output.
-
-