__Display Name

I made a post on the SDN forum in search of how to display the “display name” - used in the content editor in the Rename chunk under the Home ribbon.

This was because I was creating a breadcrumb navigation displaying either the Page Navigation or Page Title field that the content editors can enter. Page Title was a mandatory field but as a fall back I wanted to have the Display Name available for the breadcrumb.

I didn’t know the sc:text field to get the display name and thankfully a kind sir provided me the magic code for it.

Here is what I had:

<xsl:choose>
<xsl:when test=”sc:fld(’Page Navigation’,$item)!=””>
<sc:text field=”Page Navigation” select=”$item”/>
</xsl:when>

<xsl:when test=”sc:fld(’Page Title’,$item)!=””>
<sc:text field=”Page Title” select=”$item”/>
</xsl:when>

<xsl:otherwise>
… (This is where I wanted it to display the Display Name)
</xsl:otherwise>
</xsl:choose>

I’m a little embarrassed to say it was very simple, after searching for a couple of hours to figure it out!

<xsl:otherwise>
<sc:text select="$item" field=”__Display Name”/>
</xsl:otherwise>

That did the trick! Thank you Mr. John West!

Notes

  1. lizbeth-watson reblogged this from km-sitecore
  2. km-sitecore posted this