Categories > TinyButStrong general >

Conditional tags which have mysql array variables do not work.

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: desbest
Date: 2010-05-24
Time: 15:40

Conditional tags which have mysql array variables do not work.

Conditional tags which have mysql array variables do not work.

When the variable [categories.id] equals 1, the div should show, which has an image inside it. The image does not show even though the value is 1 as it is echoed before the div with the button2 class.

         <div class="listinglight">
            <a href="index.php?category=[categories.id;block=div]" class="active">[categories.title]</a>
            [categories.id]<div class="button2">[onload_5;block=div;when [categories.id]=1]
               <img src="icons/full.png" title="The uncategorised category has items in it." width="24" height="24" align="right"><img src="spacer.gif" width="1" height="0" align="">
               <!-- weird jquery slide indent fix --></div>
         </div>

Any ideas?
By: Skrol29
Date: 2010-05-24
Time: 23:26

Re: Conditional tags which have mysql array variables do not work.

Hi Desbest,

[onload_5] is merged when the template is loaded, it means that the block [categories] is not merged yet. Thus the condition "[categories.id]=1" is always false.

You should replace
  [onload_5;block=div;when [categories.id]=1]
with
  [onshow;block=div;when [categories.id]=1]

The other way is to use magnet with "mok" (TBS >=version 3.5.2):
[categories.id;magnet=div;ope=mok:1]
By: desbest
Date: 2010-05-25
Time: 10:15

Re: Conditional tags which have mysql array variables do not work.

What is a magnet?
By: Skrol29
Date: 2010-05-25
Time: 10:24

Re: Conditional tags which have mysql array variables do not work.