Categories > TinyButStrong general >

parameter in URL not able in if clause?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Adriane
Date: 2011-09-20
Time: 19:56

parameter in URL not able in if clause?

Hello,

if I do something like this:

[Exposition.ReferenceHomepageURL; if [val] != ''; then '
   
    <br />More information: <a href="[Exposition.ReferenceHomepageURL]" target=_blank > [Exposition.ReferenceHomepageURL]</a>
   
    '; else '';]

and the Exposition.ReferenceHomepageURL = http://www.wettbewerb-kulturstiftung.de/show_project_short_neu.aspx
it works, if it's like:
http://www.wettbewerb-kulturstiftung.de/show_project_short_neu.aspx?ID=4201
it does not work.

In the second case with parameter it goes into the else case, but if I display [val] in the else case it's "http://www.wettbewerb-kulturstiftung.de/show_project_short_neu.aspx?ID=4201".
So why is it taking the else case and what do I have to change that it works?

Greetings
Adriane
By: Skrol29
Date: 2011-09-21
Time: 00:16

Re: parameter in URL not able in if clause?

Hello Adrian,

This is because [val] contains the symbol "=".
You should replace:
if [val] != ''
with:
if '[val]' != ''
TBS first replace the [val] tag in the expression, and then it evaluate the expression. That's why symbol like "=" or "'" should be protected.

Nevertheless, your snippet could be simplified into:
<br />More information: <a href="[Exposition.ReferenceHomepageURL]" target=_blank > [Exposition.ReferenceHomepageURL;magnet=br+(a)]</a>