Breadcrumbs

Using $context

The variable $context is used in the default Scroll HTML Exporter theme. This documentation explains how to use that variable for your own themes. Depending on choices made in the export configuration, we can determine if a section of a template would be able to be displayed or not.

Overview

The table below outlines Objects that can be used to get information about the export process.

object

type

usage

note

properties/methods/value

ExportMode

String

This is mostly here to determine the display method.
If all contents are in one page, you need to have another means of navigation, than for a single html page.

Contains selected option for General>Create

  • default for "one HTML file for each Confluence page"

  • single-page for "a single large HTML file"

ConfigurationProperties





SourceTree.Children

Array[Page]

You recursively loop through all pages and their children.
Example: 

#foreach($child in $context.SourceTree.Children)
    $child.displayTitle
#end


This is the tree of pages generated

  • children - a list of all children pages

  • DisplayTitle - Title of that page

  • Id - ID of the page

WorkDirectory

File

Contains information about the File. All available methods and properties are available in the Java docs for

java.io.File

.



LinkNamingStrategy

Object

This is used to determine which href to use when linking to another page.
Example: $context.getLinkNamingStrategy().generateLinkString($page)
where page  



CombinedSectionLevel

Number

Used for rendering the section override



BuildSearchIndex

Boolean

true or false