Use different template sections for root page and child pages?

Comments

5 comments

  • Avatar
    Sean Mahnken

    To further expound why I am asking this...

    We have certain sections in our document that we'd like to appear before the table of contents, such as an approvals table and document revision history.  This content would also use a different page numbering scheme (i, ii, iii...), and NOT be included in the ToC.  Said content is included on the root page.

    Further extending the concept, we also have appendices which (ideally) would use a different heading numbering scheme (A, B, C...).

    So an ideal template stack would look like

    Title
    Root Page Content
    TOC
    Main Content (from child pages)
    Appendix Content (from child pages)
    Index

    The easiest way I can think to accomplish this would be to have a page macro that I could place on each page that would indicate which section that page should be placed in during the export.  Then I could create the sections in the template as needed and just add the page macros with the desired section names.  As best I can tell, that functionality does not exist today...

    0
    Comment actions Permalink
  • Avatar
    Thomas Rough (K15t)

    Hi Sean,

    Thanks for your post. At the moment, it is not possible to define Confluence content to print between different pages when exporting with our app. This means that any content (which isn't on your pages) that you want to see appear before the table of contents would need to be added to a static page in your custom template. By the sounds of it, this could be achieved if there was a placeholder available that rendered this content. Currently, we have open improvement for introducing a placeholder that can include the page revision history content and you can track this here: https://k15t.jira.com/browse/EXP-1227. By the sounds of it, this would meet your requirement if introduced. Is that correct?

    This would also then allow you to use the page numbering functionality that we have available in the custom templates, so you can have different format of numbering, such as Romana Numerals, appear before the ToC and/or actual content. Are you already using this?

    Thanks, Thomas (K15t)

    0
    Comment actions Permalink
  • Avatar
    Sean Mahnken (Edited )

    Hi Thomas,

    Thanks for the reply.  The feature you're pointing to would almost work, but not quite.  The version history we want to see would only include released versions of the document, not the full Confluence change history.  So we have to explicitly create a table to include the content.

    I did figure out a way around the issue, though it is somewhat cumbersome.

    1. Create individual pages with the content which should be before the ToC.  Label each page with something like "noexport".

    2. In the Scroll exporter template, add the applied label to the "Exclude" list under Settings -> Properties -> Labels.

    3. Add a static section in the Scroll exporter template before the ToC.  In the section, insert an "Include Page" placeholder, and set the placeholder to include that page that was excluded by label.

    It would be more elegant if there were a placeholder which would indicate "target this page to section X".  Then we could skip the "no export" + explicit include setup.

    Thanks, Sean

    0
    Comment actions Permalink
  • Avatar
    Thomas Rough (K15t)

    Hi Sean,

    Thanks for your reply and for providing the workaround steps you've taken. Your approach seems the most suitable for such a use case and at the moment, there aren't any immediate plans to introduce any way in which to achieve something similar via a new placeholder.

    However, if there are any changes/updates to the way in which you can define how content is included in the generated export I'll provide further information in this thread.

    Thanks, Thomas (K15t)

    0
    Comment actions Permalink
  • Avatar
    Sean Mahnken (Edited )

    There is one major drawback to the approach I used: Since you must explicitly use an "Include Page" macro, and because that macro uses the page title to get the page, you effectively must have a unique template for each document.  This becomes cumbersome quickly as the number of documents increases.  It also makes it impossible to have a single template to generate all documents with.

    My workaround would be much better if I could "Include Page" by a label, with the search for that label starting at the root of the export.  That would allow us to create a template that could be used with multiple documents at least.

    Of course, having a macro that would tell the export which section to put the page in would still be the most elegant way to do it.  :-)

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk