Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the Name, version, tcm id of the component in XSLT TBB

I am working on a XSLT Template Building Blocks in SDL Tridion 2011 SP1 using the XSLT mediator.

I just wanted to know, how to get the Name of component, Version and its TCMID while rendering.

Can any one help how it can be done?

like image 344
Patan Avatar asked Dec 16 '22 00:12

Patan


2 Answers

After clearly observing the output in the Template Builder, I got answer as

<xsl:element name="TCMID">
  <xsl:value-of select="tcm:Component/@ID"/>
</xsl:element>
<xsl:element name="name">
  <xsl:value-of select="tcm:Component/tcm:Data/tcm:Title"/>
</xsl:element>
<xsl:element name="Version">
  <xsl:value-of select="tcm:Component/tcm:Info/tcm:VersionInfo/tcm:Version"/>
</xsl:element>
like image 122
Patan Avatar answered May 15 '23 13:05

Patan


Probably not a complete answer to your question, but Package Items should be available as arguments to the template. So if you need to access a value that is not in the Component XML you could add it to the Package before you run the XSLT TBB.

like image 30
Arjen Stobbe Avatar answered May 15 '23 13:05

Arjen Stobbe