Skip to main content
Skip table of contents

Defining static content

You can create static pages to be displayed in your EPUB file like title pages at the beginning of your EPUB file or legal notices. Before you begin: To create static pages, a template must exist and you must log in with Confluence Admin permissions.

Create your Static Page

First you have to create a new HTML file with the wanted content for your static page.

  1. Create a new HTML file in your EPUB template.
  2. Define a title and insert the content of your static page.
  3. Save the HTML file, for example 'titlepage.html'.

Link to the Static Page in the resources.opf.vm

The new HTML file needs to be linked in your template.

  1. Open the file resources.opf.vm with a texteditor.
  2. Scroll down to the <manifest>-tag and link to the HTML file by copying an existing <item>-tag and customize it. For example:

    CODE
    <item id="titlepage" href="titlepage.html" media-type="application/xhtml+xml"/>


    (info) The manifest-tag defines which files should be included in the exported EPUB-file.

  3. Scroll down to the <spine>-tag and insert the itemref to the spine at the wanted position. For example:

    CODE
     <spine toc="ncx">
            <itemref idref="titlepage"/>              <!-- Add this line -->
            #macro(epubItemref $source)
                #if($source.Children.size() == 0)
                    <itemref idref="_$source.id"/>
                #else
                    <itemref idref="_$source.id"/>
                    #foreach($child in $source.children)
                        #epubItemref($child)
                    #end
                #end
            #end
            <itemref idref="_$context.sourceTree.id"/>
            #foreach($child in $context.sourceTree.children)
                #epubItemref($child)
            #end
        </spine>

    (info) The spine defines the sequence of the HTML files inside the exported EPUB-file. The epubItemref macro is used to generate <itemref>-tags for the exported Confluence pages.

Link to the Static Page in the atlassian-plugin.xml

Finally you have to link the static page in the XML-file. This ensures that the Scroll EPUB exporter copies your HTML file from the template into the EPUB file.

  1. Open the file atlassian-plugin.xml with a texteditor.
  2. Scroll down to the <resource>-tags and link to the static page. For example:

    CODE
    <resource type="static-resource" name="titlepage.html" location="template/titlepage.html" />
  3. Save the file and upload your template as jar-file.

When you use the template, the static page is inserted at the defined position with the wanted content.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.