Sitecore: How to Get "Display Name" in XSLT
I tried
<sc:text field="Display Name" />
and<xsl:value-of select="sc:fld('Display Name',.)"/>
and<xsl:value-of select="sc:field('Display Name',.)"/>
a variety of different events and intervals.
All I can find on the Internet are examples of how to get it in .NET code Sitecore.Context.Item.DisplayName
Am I missing something obvious? It bothered me a little.
You can use the display name of the method from XSLHelper (namespace: Sitecore.Xml.Xsl)
this will be used in xslt, like this
<xsl:value-of select="sc:displayname($sc_currentitem)" />
: , ,
, .
public string DisplayName
{
get
{
if (!UserOptions.View.UseDisplayName)
{
return this.Name;
}
string text = base[FieldIDs.DisplayName];
if (text.Length > 0)
{
return text;
}
return this.Name;
}
}