Categories > TinyButStrong general >

conditional display [blocks]

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: PFPRO
Date: 2006-05-22
Time: 13:29

conditional display [blocks]

ola

<table>
<tr class="[blk_paged.gesamtstatus;if [val]='demo';then 'inactive']">
   <td align="center">
    [...]

works perfect for me

BUT

<table>
<tr>
   <td align="center">

   [blk_paged.aktiviert;if [val]!='ON';then '<a onclick="return (confirm('Status [[blk_paged.art_nr]] wirklich ändern?'));" href="[var..script_name]?action=switch&state=1&pid=[blk_paged.id][var.query_ext]"><img src="../../img/icon_0.png" border="0"></a>']

   [blk_paged.aktiviert;if [val]='ON';then '<a onclick="return (confirm('Status [[blk_paged.art_nr]] wirklich ändern?'));"  href="[var..script_name]?action=switch&state=0&pid=[blk_paged.id][var.query_ext]"><img src="../../img/icon_1.png" border="0"></a>']

    [...]


works almost perfect -
but will output some unwanted extra apostrophes ['] surrounding the <a href> tag

problem disappears when i remove the onclick property

noticed that the way i used tbs
[blk_paged.aktiviert;if [val]!='ON';then ' ...
is not mentioned in the (old) manual at all
but it works

but for all that could u give me hint skrol?

haven't had time to convert many tbs2 projects -> 3.0 :(
but looking forward

cheers
phil
By: Skrol29
Date: 2006-05-22
Time: 22:59

Re: conditional display [blocks]

Hi,

You should escape ' by '' when embedded between two ' as a TBS parameter's value.

example:
...;param='hello it''s me';...

By the way, parameter magnet can be usefull to delete nicely an image tag.