By: dmyers
Date: 2013-01-25
Time: 17:04
|
if-then-else statements seem to be completely ignored in .odt templateI have the following section in an odt template:
The field is being merged properly, but the if statements are completely ignored. Instead of displaying the appropriate 'then' message, it simply shows the value of 'data.ADM_EA_PAR'. Can anyone shed some light on what is wrong? Thanks |
|
By: dmyers
Date: 2013-01-25
Time: 20:14
|
Re: if-then-else statements seem to be completely ignored in .odt templateOk, after messing with it some more, I found it is related to a problem I've been seeing where TBS fields are no longer recognized if they have been modified. This means that if I have a field [var.data.ADM_EA_PAR] and I change it to [var.data.ADM_FNAME], then I would get the following error message:
The only way around it is to completely remove the [...] text and rewrite it. I don't know if this is a bug with TBS or libreoffice doing something strange when saving the document. |
|
By: Sarah
Date: 2013-01-25
Time: 20:23
|
Re: if-then-else statements seem to be completely ignored in .odt templateI don't know if this will help, but var in place of onshow or ondata is deprecated. Have you tried using:
(or onload or ondata if that works better for you) Secondly, if LibreOffice is like MS Word, it likely inserts extra tags inside of the TBS tag whenever you edit (in order to help the GUI return to your previous place when you hit undo). It may also insert extra tags if there are spelling or grammar errors there. Removing the tag and starting again would clear out these extra tags, but every time you edit them again the same will occur. I wrote a tip about removing these tags in MS Word which may be applicable: http://www.tinybutstrong.com/forum.php?thr=3072. Basically, if you are seeing any grammar or spelling issues, run your spell check and make sure you ignore any problems in TBS tags. This may help. You can see the problems TBS is encountering when you get these errors by using $TBS->PlugIn(OPENTBS_DEBUG_XML_SHOW): http://www.tinybutstrong.com/plugins/opentbs/tbs_plugin_opentbs.html#debug |