How do you include Static Content in the TOC in Scroll PDF Exporter?

AB September 11, 2013

Is there a way to include static content in the table of contents in Scroll PDF Exporter?

The current scenario that I have is as follows:

  1. A new Content tab has been added in Static Pages (which has the Before Content and After Content sections). This tab is placed after the TOC tab.
  2. A specific page has been included in the Before Content section, with the following code:

    $include.getPage(<PAGE_TITLE>)
  3. In the TOC tab, I currently have the following content:

    <h1>Contents</h1>
    $toc

Any suggestions as to how the <PAGE_TITLE> page can be incorporated into the table of contents is very much appreciated.

1 answer

1 accepted

3 votes
Answer accepted
Jens Rutschmann _K15t_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 24, 2013

Hi Ana,

you can add arbitrary elements to the toc by using this replacement:

${toc.addTocEntry("<THE_TOC_LABEL>")}

The replacement generates an ID which must be added to an HTML element where the link in the toc should point to.

For example:

&lt;h1 id="${toc.addTocEntry("My included page")}"&gt;My included page&lt;/h1&gt;

Hope this helps,
Jens
AB September 30, 2013

Thanks for the reply Jens, and apologies for the late reply. I will try out your suggestion, and will get back to you on how I go.

AB October 7, 2013

Hi Jens,

I tried your suggestion as follows:

<p id=${toc.addTocEntry("<THE_TOC_LABEL>")}></p>

...and it worked perfectly well!

Thanks again!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events