do I have to keep the class description?
this does not affect the value of XSL
, it's a div tag
that use description
class for only design/display purpose
is the ddwrt correct?
yes it's correct , 2057 denote to LCID
that is English for united kingdom , and 3 is format flag
that display date as this format 23 March 2016
Also, you can replace it with 1033 for English-United State .
what do I have to write after @? (line 2) My Date in the source list is called 'Action delivery date'
You should get the internal name of 'Action delivery date'
and but it after @
so space should be replaced by _x0020_
so the internal name should look like
Action_x0020_delivery_x0020_date
And the final ddwrt
<xsl:value-of select="ddwrt:FormatDate(@Action_x0020_delivery_x0020_date, 2057, 3)" />
Note : to get the internal name > open your list > list settings > click on your column > from the address bar check the field query string Field=
Note : you can add it as @Actiondeliverydate
where this is the field display name but when you try to edit CQWP and set it's value you should add its internal name.
[Update]
Although the above instructions are valid , but unfortunately, Susan told me : It does not display anything.
In fact, The date variable is shown but the forecolor
is white , so you will tell me I should remove description class
?
But this also not a solution, if you remove the class it still shows as white so you should set your custom style at the div tag like this <div style="color:black">
or build your custom class
So the final code based on the provided template in chat, should be
<xsl:template name="Actions" match="Row[@Style='Actions']" mode="itemstyle">
<xsl:variable name="SafeLinkUrl">
<xsl:call-template name="OuterTemplate.GetSafeLink">
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="DisplayTitle">
<xsl:call-template name="OuterTemplate.GetTitle">
<xsl:with-param name="Title" select="@Title"/>
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
</xsl:call-template>
</xsl:variable>
<div class="item link-item">
<xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>
<a href="{$SafeLinkUrl}" title="{@LinkToolTip}">
<xsl:if test="$ItemsHaveStreams = 'True'">
<xsl:attribute name="onclick">
<xsl:value-of select="@OnClickForWebRendering"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'">
<xsl:attribute name="onclick">
<xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/>
</xsl:attribute>
</xsl:if>
<xsl:value-of select="$DisplayTitle"/>
</a>
<div style="color:black">
<xsl:value-of select="ddwrt:FormatDate(string(@Actiondeliverydate), 2057, 3)" />
</div>
</div>
</xsl:template>
[Output]
Note:
In the above example : I used @Actiondeliverydate
not the internal name, I found out this the field display name and not should be the internal name ,
but when you edit your CQWP web part , you should provide the internal name of 'Action delivery date'
field that in this case is Action_x0020_delivery_x0020_date
that will be transferred back to Action delivery date
@Date
should be@InternalNameOfYourDateTimeField
@Action_x0020_delivery_x0020_date
as in @M.Qassas answer :)