Categories > OpenTBS with DOCX >

docx template creation

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Robert Henniger
Date: 2013-07-25
Time: 15:16

docx template creation

Hi.

I was looking for a tutorial how to create a docx template for OpenTBS but had no luck.
How can i insert a placeholder and a loop (MergeBlock)? IS this done over word or do i need to change the word/document.xml file?

Thanks in advance for a hint into the right direction.
By: Sarah Kemp
Date: 2013-07-25
Time: 17:39

Re: docx template creation

You can get an idea of what parts are required and what code goes where in the OpenTBS Demo: http://www.tinybutstrong.com/plugins/opentbs/demo/demo.html

Essentially using OpenTBS is just like using TBS, only you place your TBS tags ([]) in your docx file rather than in an html file. You can see an example of block syntax here: http://www.tinybutstrong.com/examples.php?e=blocks

You can edit your template in Word. You shouldn't need to edit the document.xml directly. You would put the placeholder where you want it in your Word document, then have a separate PHP file that instantiates TBS, adds the OpenTBS plugin, gathers whatever data you want to use, call MergeBlock(), then Show().