Link to home
Create AccountLog in
Avatar of DreyTech
DreyTechFlag for Puerto Rico

asked on

Conditional Formatting

I need to know how to code in XSL for SharePoint 2010 (via SharePoint Designer) the following statement for a webpart:

If the created date of an item is older than two days, show alert icon on alert column.
User generated image
The conditional formatting would be something like this:

<td align="center">
            <xsl:attribute name="style">
                        <xsl:if test="ddwrt:DateTimeTick(ddwrt:GenDisplayName(string($thisNode/@Created))) &lt; ddwrt:DateTimeTick(ddwrt:GenDisplayName(string($Today)))" ddwrt:cf_explicit="1">color: #FF0000;</xsl:if>
            <span class="fa fa-exclamation" />

I have not been able to get this to work. It is a custom webpart with filters already applied to it.
Avatar of Jamie McAllister
Jamie McAllister
Flag of Switzerland image

I did something very similar to that here;

See if that guidance helps.
Avatar of DreyTech


Hello Jamie! Thank you for the prompt answer, it is helpful, however, this is not what I am looking for.

I need to show the alert icon if a case has been open for more than 2 days. So if for example I were to create a case today (june 11, 2015), the alert icon should pop up two days later (june 13, 2015).

Is there any way to calculate this using xsl so that I can use it on my webpart?
Avatar of Jamie McAllister
Jamie McAllister
Flag of Switzerland image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account