Categories > OpenTBS with DOCX >

Dynamic Docx Generation

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Maggie Benson
Date: 2015-05-05
Time: 15:49

Dynamic Docx Generation

Playing around with OpenTBS to see if it's the best tool for my needs.

Is there a way to go off a template but then if there are variables that do not exist in my PHP to not have those show up on the Docx at all?
By: Skrol29
Date: 2015-05-06
Time: 10:46

Re: Dynamic Docx Generation

Hi,

I'm not sure to understand what you need.
Could you explain with more details ?
By: Maggie Benson
Date: 2015-05-06
Time: 16:28

Re: Dynamic Docx Generation

Sorry,

So how would I make conditional statements for content that is shown in the docx template?

If I have a variable in my PHP ($SectionA) and it is set to true, I want the template to show a particular section or page of content and show any variables that might apply to that section of the template.
But if that $SectionA variable is set to false, then I want it to ignore that section of the template altogether and leave it out.
By: Skrol29
Date: 2015-05-06
Time: 20:38

Re: Dynamic Docx Generation

Conditional section is a basic feature in TBS.

See the principle :
http://www.tinybutstrong.com/manual.php#html_conditional_section

Example with HTML sections:
http://www.tinybutstrong.com/examples.php?e=cond&m=result

And they are some example in the DOCX demo
http://www.tinybutstrong.com/opentbs.php?demo