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>
            </xsl:attribute>
            <span class="fa fa-exclamation" />
</td>


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; http://the-north.com/sharepoint/post/Replace-Task-List-Status-Column-with-Icons-in-SharePoint-2010

See if that guidance helps.
Avatar of DreyTech

ASKER

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?
ASKER CERTIFIED SOLUTION
Avatar of Jamie McAllister
Jamie McAllister
Flag of Switzerland image

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