Help with "If"
This is an open discussion with 2 replies, filed under XSLT.
Search
nm i got it….
<xsl:if test="link-to-site"> <li><a href="{link-to-site}" class="projectlink"><xsl:value-of select="link-to-site"/></a></li> </xsl:if>
i used that.
The more declarative way to do it would be with XPath, making one template that matches on projects with a link , and another that matches on projects without:
<xsl:template match="projects/entry/link/text() !=''"> <!-- make li including a link--> </xsl:template> <xsl:template match="projects/entry/link/text() =''"> <!-- make li with no link--> </xsl:template>
You have to test for content of the element, b/c Symphony will output a blank element for your ‘link’ field.
Create an account or sign in to comment.
hello. So i am having trouble getting this done. I have a list of projects and some of them have a link to a different website. but not all have this link.
thats how i have it but now each project has a black little button even thou it has no link…
Is there some XSLT code that i can do like the IF…if it has a link then had it to the list?
thanks