0

I have been attempting to create status indicators in Sharpeoint Designer 2010 using two background images (red and green circles) in a hyperlink column and conditional formatting. The idea is that the hyperlinks direct to a list and the background image indicates the status of that list. I have been using the xsl:choose element to pick which cirle gets displayed behind the hyperlink.

<xsl:attribute name="style">
    <xsl:choose>
       <xsl:when test="$thisNode/@prodimpnumber != '1'" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:cf_explicit="1"> background-image: url(&apos;../images1/red indicator small.png&apos;); background-repeat: no-repeat; background-position: center center; line-height: 100px; vertical-align: middle; text-align: center;
       </xsl:when>
       <xsl:otherwise> background-position: center center; background-image: url(&apos;../images1/green indicatorsmall.png&apos;); background-repeat: no-repeat; vertical-align: middle; text-align: center; line-height: 100px; font-weight: bold;
       </xsl:otherwise>
    </xsl:choose>
</xsl:attribute>

My issue is this: in sharepoint designer the indicators display properly in SPD i.e. display green cicle if the relevant column isn't equal 1 and otherwise display red circle,
however on the actual page only green circles are displayed. Here how the indicators look in SPD SPD display of status indicators

Here is how the page looks enter image description here

I can't figure out what's happening or how to fix it. Assistance would be greatly appreciated.

0

I could replicate this behavior, so I'm afraid you have missing the reference for the "prodimpnumber" column on the View properties.

I made a similar condition criteria mentioning "Column1", and then I comment the reference like following:

<View Name="{0C5D6622-FA99-4D41-9F5B-BC61F040CD83}........>
                        <Query/>
                        <ViewFields>
                            <FieldRef Name="LinkTitle"/>
                            <!-- <FieldRef Name="Column1"/> -->
                            <FieldRef Name="Column2"/>
                            <FieldRef Name="Column3"/>
                            <FieldRef Name="Column4"/>
                            <FieldRef Name="Column5"/>
                        </ViewFields>
                    </View>

<xsl:if test="$thisNode/@Column1 != '1'">background-color: #FF9966;</xsl:if>

After this I still see a correct behavior on SPD but when I published the page it just didn't show the sytle on browser.

Hope it helps, Regards

  • This worked. Turns out like your post suggested the reference was missing. Thank you very much agzertuche – user111023 Jul 11 '14 at 9:55

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.