0

In the snippet below, I want to be able to change the value in the first href= to a different WP form based on another value in the list. I want to embed the code in conditional statements to test for values. The Management Appraisal... is defined in Manage Connections.
I want to override the Connection value.

</tr><tr><td class="style6" style="width: 8%">Form ID<a href="{@Tier_Appraisal_URL}"></a></td><td><a href="Management Appraisal copy - Emp.aspx"><xsl:value-of select="@Tier_Appraisal_URL.desc" /></a></td></tr>

I think it should be simple but I cant come up with correct syntax.

1

There are 2 ways to do conditional logic in xslt/dvwps, xsl:choose and xsl:if. They operate in similar ways but can give you different results. xsl:if only happens when the test evaluates to true, xsl:choose will always return something. Typical usages:

You are guaranteed to get one of these in the markup

<xsl:choose>
    <xsl:when test="@Field = 'A'">
        Foo
    </xsl:when>
    <xsl:when test="@Field = 'B'">
        Bar
    </xsl:when>
    <xsl:otherwise>
        Baz
    </xsl:otherwise>
</xsl:choose>

This will onlybe output if Field equals A, but if Field equals B it gets skipped

<xsl:if test="@Field = 'A'">Foo</xsl:if>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.