n-up layout

58 views
Skip to first unread message

Michael Wiktowy

unread,
Mar 12, 2018, 4:27:06 PM3/12/18
to TiddlyWiki
Hi all,

I made an n-up type layout tiddlywiki for printing out badge cards, mailing labels, etc. using contacts stored in tiddlers. If the @page rule in CSS worked, it would be absolutely "trivial" to do this type of layout. Just a <div {width} {top-margin} {left-margin}>{{{filter||template}}}</div> while your template can be a bunch of display:inline-block divs and things would properly paginate.

However, I have found out that the @page rule that is intended to handle print page margins in this scenario is wildly inconsistently implemented among different browsers. Latest Firefox can be persuaded to cooperate put Chrome wants to always apply manually defined margins. Which can be made to work but you need to know what to manually set things to each time and that changes template to template.

To get around this, I would like to have the user set the print margins manually to "none" and handle the margins via div tags. However, I cannot figure out if it is possible for tiddlywiki to iterate through a filter in n-sized chunks until there are no filter items left. You can seemingly do so up to some predefined finite limit just by calling [tag[contact]first<n>] and then using a bunch of rest<m*n>limit<n> to keep displaying m chunks of n templates grouped in a div with proper margins. But you would need to know how many contacts to design for in planning your proof sheet as there doesn't seem to be a way to use [tag[contact]count[]] to loop through things count[]/n times.

Is there some way of using filter operators in this manner where you don't need to know how many contacts in advance?

/Mike
Reply all
Reply to author
Forward
0 new messages