Get url from tcm

I am trying to get the url of a multimedia component in render xslt, but it still doesn't work.

I can get the tcm URI. Is there any way to get the url from this?

I tried using tcmse: PublishBinary, but with the error "Namespace" http://www.tridion.com/ContentManager/5.1/TcmScriptAssistant 'does not contain any functions.

<table cellspacing="0px" cellpadding="0px" style="border: 0; padding: 0px; width: 100%"> <xsl:for-each select="twf:items/twf:item"> <tr> <td colspan="2"> <!-- <xsl:value-of select="twf:webformscomponentlink/@xlink:href" /> --> <!-- <xsl:value-of select="tcmse:PublishBinary(string(twf:webformscomponentlink/@xlink:href))" /> --> <span> <xsl:call-template name="replace-new-lines"> <xsl:with-param name="string"> <xsl:value-of select="twf:linklabel" /> </xsl:with-param> </xsl:call-template> <xsl:text> </xsl:text> </span> <xsl:element name="a"> <xsl:attribute name="href"> <xsl:choose> <xsl:when test="twf:webformscomponentlink/@xlink:href"> <xsl:value-of select="twf:webformscomponentlink/@xlink:href" /> </xsl:when> <xsl:otherwise>#</xsl:otherwise> </xsl:choose> </xsl:attribute> <xsl:value-of select="twf:linktext" /> </xsl:element> </td> </tr> </xsl:for-each> </table> 

Thank you very much

+4
source share
1 answer

You mention that you are trying to enable the multimedia component in Render XSLT, and in the tags I see WebForms, so I assume its Render XSLT template component SDL Tridion WebForms.

WebForm is a presentation with a dynamic component, and the component template uses two XSLTs, one on the Expand XSLT tab, which runs during publication when the publisher displays the template code on the CMS. The dynamic template is different; it contains XSLT, which is copied at the time of publication as in Content Broker. When you request your view of WebForms components, the Dynamic Template is used to convert Expand XML to your WebForm.

Since the dynamic template is executed at the time of the request, at this point TcmScriptAssistant is no longer available (it exists only on the Content Manager side at the time of publication). The solution is to enable the Multimedia component in the Expand Template, using tcmse:PublishBinary() , in the Render Template, you can only convert / display the results of the Expand Template, but you do not have access to the CM functions at this point.

+1
source

Source: https://habr.com/ru/post/1442274/


All Articles