Piers Karsenbarg
Piers Karsenbarg

Reputation: 3201

How do I get the Item Name using an XSL rendering?

I have an xsl rendering that looks through a list of items.

I want to put the Item Name (as in what you see under Quick Info for an item) into a variable.

To do this for a field that is entered in the Builder tab you would do this:

<xsl:variable name="variablename" select="sc.fld('Field Name',.)" />

but I'm not sure what the name for the Item Name is. Is it <xsl:variable name="variablename" select="sc.fld('Item Name',.)" /> or <xsl:variable name="variablename" select="sc.fld('ItemName',.)" /> or is it not possible to get this?

Upvotes: 1

Views: 159

Answers (1)

Trayek
Trayek

Reputation: 4410

You can use the @name property.

Like so:

<xsl:variable name="itemname" select="./@name" />

By the way, if you want the Display Name instead you need to use:

<xsl:variable name="displayname" select="sc:fld('__display name',.) />

Upvotes: 4

Related Questions