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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published yesterday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

62 views 0 4
Read article

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