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

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

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

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.

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
Community showcase
Posted Oct 11, 2018 in Marketplace Apps

You + one app + a desert island...

Hi all! My name is Miles and I work on the Marketplace team. We’re looking for better ways to recommend and suggest apps that are truly crowd favorites, so of course we wanted to poll the Community. ...

3,523 views 6 6
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you