TinyButStrong - the PHP Template Engine
Categories > [old] TbsOoo & TinyDoc >

conditional tag fit in another conditional tag then parameter

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs

By: Arnaud Morvan
Date: 2010-06-23
Time: 03:05

conditional tag fit in another conditional tag then parameter

I've try to fit conditional tag in then parameter of another conditional tag. Exemple :
[onshow; if [field.key] = 1; then 'It''s a conditional tag with [onshow; if [field.anotherkey] = 1; then 'another conditional tag'; else 'another alternative'] fit in.']
but on line 3206 (tbs 3.5.3), in f_Loc_PrmCompute, in the test
if ($DelimCnt===1) { // Delete quotes inside the value
$DelimCnt has a value upper than 1 so the test return false.

I've try to change this test with $DelimCnt>0, but if the inner conditional tag parameters contains quotes, it will apply, so I suppose tbs will not detect the parameters correctly during the inner conditional tag treatment.

Finally, when I'm writing this post, I find the correct formulation :
[onshow; if [field.key] = 1; then 'It''s a conditional tag with [onshow; if [field.anotherkey] = 1; then ''another conditional tag''; else ''another alternative''] fit in.']
I've to double the quotes in the inner conditional tag parameters, so $DelimCnt if effectively equal to 1 and everything works good.

Thank you for TBS, I will use it with symfony for preparing OpenOffice documents so the user would customise his models directly with OO and without PHP skills.
By: Skrol29
Date: 2010-06-23
Time: 10:17

Re: conditional tag fit in another conditional tag then parameter

Hi Arnaud,

Thank your for sharing this information.