iainc / iA-Writer-Templates

Preview, create PDFs, and print documents in your own style with templates in iA Writer.

Home Page:https://ia.net/writer/templates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Page decoration

schriftgestalt opened this issue · comments

Is there a way to have different styles on different pages? Something like some header on the first page but not on the following pages?

I’ll try to write a template to use as my letter head. The first page should have all the address fields and some graphical elements, but all following pages should have different styles.

Currently, all pages show the same header. We recommend including the letter head into IATemplateDocumentFile. Address could be placed directly into documents by wrapping it with an HTML tag.

<address>
221B Baker Street,
London NW1 6XE
UK
</address>

We’ll consider a more flexible layout system for a future update. Thank you.

A solution came up while discussing a similar issue with another customer. If you’re familiar with JavaScript, this should point you in the right direction.

window.addEventListener("load", function() { 
  document.getElementById("page-number").addEventListener("ia-writer-change", function() {
    if (document.getElementById("page-number").innerHTML === "1") {
      document.getElementById("letter-head").style.display = block
    } else {
      // Footer is reused for all pages.
      document.getElementById("letter-head").style.display = none
    }
  })
})