if, else question
Permalink Browser Info Environment
Hi,
I am trying to display some information depending on the value of a field. If field "Direct Link" has the value "Direct Download" I want to show the "Downloadable file" field. Else I want to show the "Direct Link" field. I have tried with comparison="contains" and with comparison="equal to" with exactly the same results.
I find that for some (and not all) of the records where the field "Direct Link" doesn't has the value "Direct Download" I get the two href printed (both the one inside the if branch and the one inside the else branch).
I give here two examples of particular records with different behaviours when they are supposed to behave the same:
1) Field "Direct Link" for a particular record contains "http://www.unima.mw/wp-content/uploads/2012/07/2012-2017-UNIMA-Strategic-Plan-30-March-2012.pdf" and the behaviour is correct: it shows just the link (else branch).
2) Field "Direct Link" for a particular record contains "http://www2.aau.org/aucc/docs/univ_gaston_berger_LOI.pdf" and the behaviour is incorrect: it shows the link inside the if branch and also the link inside the else branch.
This is the code I am using:
I am trying to display some information depending on the value of a field. If field "Direct Link" has the value "Direct Download" I want to show the "Downloadable file" field. Else I want to show the "Direct Link" field. I have tried with comparison="contains" and with comparison="equal to" with exactly the same results.
I find that for some (and not all) of the records where the field "Direct Link" doesn't has the value "Direct Download" I get the two href printed (both the one inside the if branch and the one inside the else branch).
I give here two examples of particular records with different behaviours when they are supposed to behave the same:
1) Field "Direct Link" for a particular record contains "http://www.unima.mw/wp-content/uploads/2012/07/2012-2017-UNIMA-Strategic-Plan-30-March-2012.pdf" and the behaviour is correct: it shows just the link (else branch).
2) Field "Direct Link" for a particular record contains "http://www2.aau.org/aucc/docs/univ_gaston_berger_LOI.pdf" and the behaviour is incorrect: it shows the link inside the if branch and also the link inside the else branch.
This is the code I am using:
<field name="Direct Link" placeholder="directLink" /> <field name="Downloadable file" placeholder="downloadableFile" /> <li> <h3> <if name="Direct Link" comparison="contains" value="Direct Download"> <a href="{{downloadableFile}}" class="download" title="Download the document"><field name="Title" /></a> <else> <a href="{{directLink}}" class="directlink" title="Direct link to the document"><field name="Title" /></a> </else> </if> </h3> </li>
Type: | Discussion |
---|---|
Status: | New |