This is the documentation for an older version of Scroll Viewport. Here you can view the most up-to-date version of the Scroll Viewport documentation.

Theme Development FAQ

How can I access the Confluence Page ID in a template?

There is an undocumented (and unsupported feature) to access the Confluence page object and the Page ID like this:

$page.confluencePage     --> returns the com.atlassian.confluence.pages.Page
$page.confluencePage.id  --> returns the page ID

This placeholder may not be supported in future versions on Scroll Viewport.

How can I disable HTML escaping for variables I set?

If you ever work with strings that are hardcoded in variables, you have to declare them as HTML. Otherwise you will get encoded HTML, once you output the variable in your theme.

You can avoid that behavior, by adding Html to the variable-name. For example:

#set($ctaTextHtml = "Are you looking for a specific <strong>Scroll Add-on</strong>?")

If you use that variable in another place - say in a macro - the final variable has to end with Html.

#set($ctaText = "Are you looking for a specific <strong>Scroll Add-on</strong>?")
#stripeCta($ctaText)


## macros/stripeCta.vm
#macro( stripeCta $textHtml)
    $textHtml
#end