I was able to publish the binaries in the XSLT component template (CT), referencing the TcmScriptAssistant namespace (xmlns: tcmse = "http://www.tridion.com/ContentManager/5.1/TcmScriptAssistant") and using the following:
<h2>PublishBinary()</h2> <xsl:element name="a"> <xsl:attribute name="href"> <xsl:value-of select="tcmse:PublishBinary(string(./@xlink:href))" /> </xsl:attribute> <xsl:value-of select="./@xlink:title" /> </xsl:element>
I recently tried AddBinary:
<h2>AddBinary() with webdav</h2> <xsl:element name="a"> <xsl:attribute name="href"> <xsl:value-of select="tcmse:AddBinary(string(./@xlink:href), '/webdav/040 CreateandBreak/Root/Media/Image', 'some_variant')" /> </xsl:attribute> <xsl:value-of select="./@xlink:title" /> </xsl:element>
The resulting markup for both:
<h2>PublishBinary()</h2> <a href="/Media/buddy_tcm7-274.jpg">buddy</a> <h2>AddBinary() with webdav</h2> <a href="/Media/Image/buddy.jpg">buddy</a>
I see that addBinary used a different folder (group of structures) as indicated in the second parameter.
Did I incorrectly enter the third parameter for the String variantID parameter? I am not sure if I should see its text in the name .jpg.
Any other differences between PublishBinary and AddBinary, especially when using XSLT CT?
I am trying to figure out whether to use each other.
For clarification, I believe this is an AddDinary Object Model of a Tridion object under the TCMScriptAssistant class (and not TOM.NET). I'm sure XSLT CT will remain supported, but I will follow another question about the best ways to handle binary files, possibly in modular templates.
Additional Information: - Trimion 2011 SP1 Schema has links to multimedia components embedded in XSLT CT pages to create โstaticโ component presentations