Pre render hooks in WebApps
Sitevision 6.2 introduces a new WebApp feature that enables code execution before page rendering starts.
What is a pre render hook?
Pre render hooks are functions that let you run code before Sitevision starts rendering a page. Hooks belong to a WebApp and have full access to Sitevision's Public API as well as WebApp specific utilities.
What hooks are available?
Sitevision offers three types of hooks:
Intended to run arbitrary code.
Return a title that will be used for the current page.
Add an element to the
<head>section of the current page.
A use case
A typical use case would be a WebApp displaying something based on a parameter. In such case it would be nice to alter the page title depending on what is shown and add open graph meta tags to describe your content. Below is an example of how this would be achieved using pre render hooks.
Refer to the pre render hooks documentation for more information.
Do you want to subscribe to News from Sitevision Developer team? Subscribe here!