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?
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>
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With