By: Cozen
Date: 2015-12-22
Time: 15:46
|
How to properly display/hide some data in a .docx by checking the var contentI just want to know how to achieve that properly:
In a .docx, If I have a variable for exemple a boolean one, I need to hide a block of content if it's true (or 1) and hide the other one and do the same reverse thing if it's 0. As far as I can see, the best way to do that is the creation of block however I can't make it works.. Exemple:
Block1 Block2 Thank you for the help and I wish you happy holidays. |
||
By: Cozen
Date: 2015-12-23
Time: 12:02
|
Re: How to properly display/hide some data in a .docx by checking the var contentI can make an if statement like that :
I saw some thread about it with [onshow;...] attribute nevertheless it didn't work at all for me.. |
||
By: Skrol29
Date: 2015-12-28
Time: 09:02
|
Re: How to properly display/hide some data in a .docx by checking the var contentHi Cozen,
Your first snippet is not correct because parameter "when" is only for block definition, that is the TBS tag that has the paremeter "block=..." So it should be:
By the way, in DOCX and ODT template, I recommend to not use "block=begin" / "block=end" because that may split an XML entity. It is better to bound the block on visible entity like "block=tbs:p". In your case it could be:
The other snippet with parameter if/then/else doesn't work because embedded TBS fields works only under special circumstances. See: http://tinybutstrong.com/manual.php#html_field You may try something else with parameter "magnet=..." and "ope=minv". |
||
By: Cozen
Date: 2016-01-07
Time: 10:03
|
Re: How to properly display/hide some data in a .docx by checking the var contentHi Skrol, thanks for the help.
I tried these two snippets however any were working. It always print me Block1 AND Block2... I tried so many syntaxes like : =1; ==1; ="1"; ='1'; etc... If I change the name of the block (table_4_0.0_block), the .docx print me all the snippet, so I'm sure that the name is correct. The field is correct too (table_4_0.0.field_25.0.field_0). I can't figure out where is the problem for now... |
||
By: Cozen
Date: 2016-01-07
Time: 12:07
|
Re: How to properly display/hide some data in a .docx by checking the var contentEDIT:
I solved my problem by using an if statement for the static text and attribute magnet to variable text. I can say it : it's fucking ugly and disgusting but it works. It takes some much time if you have a lot of text but at least it works ! |
||
By: Skrol29
Date: 2016-01-08
Time: 00:01
|
Re: How to properly display/hide some data in a .docx by checking the var contentOk.
I would be interested to have a look at your template, if it is permitted, in order to understand the difficulty. |
||
By: Cozen
Date: 2016-01-08
Time: 11:00
|
Re: How to properly display/hide some data in a .docx by checking the var contentAll the variables are added into a global array.
However each variable can be itself an array (so array of array (max 8 levels)). Exemple :
|
||
By: Cozen
Date: 2016-01-21
Time: 10:33
|
Re: How to properly display/hide some data in a .docx by checking the var contentHi,
My problem still persist ='(
This snippet print me :
If I rename 'table_4_0.0_block' into any other name, the snippet will be broken (print me the code). Thanks for the help. |