Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • urg 5 posts 23 karma points
    Jul 30, 2009 @ 13:36
    urg
    0

    Xslt macro does not render on page

    Hello all.

    I believe this has come up before as I have been trawling the forums trying to find an answer.

    Essentially, a macro that I am trying to implement creates fine in the tinymce, but on the page it displays:

    <?UMBRACO_MACRO width="200" location="test.flv" macroAlias="FlvPlayer" height="200" /> 

    The xslt macro is:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library"
    exclude-result-prefixes="msxml umbraco.library">


    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <xsl:variable name="location" select="/macro/location"/>
    <xsl:variable name="width" select="/macro/width"/>
    <xsl:variable name="height" select="/macro/height"/>

    <xsl:template match="/">

    <object class="playerpreview" type="application/x-shockwave-flash" data="player_flv_maxi.swf" width="{$width}" height="{$height}">
    <param name="movie" value="player_flv_maxi.swf" />
    <param name="allowFullScreen" value="true" />
    <param name="FlashVars" value="flv={$width}&amp;width=320&amp;height=240&amp;showstop=1&amp;showvolume=1&amp;showtime=1&amp;startimage=startimage_en.jpg&amp;showfullscreen=1&amp;bgcolor1=189ca8&amp;bgcolor2=085c68&amp;playercolor=085c68" />
    </object>

    </xsl:template>

    </xsl:stylesheet>

     

    Does anybody have any other solutions in order to add html to the tinymce editor? I see that the is this solution [ http://forum.umbraco.org/yaf_postst5126_Parsing-ltUMBRACOMACRO-gt-tags-with-xsl-when-embedded-within-data-node.aspx ] but I am unsure how to implement it.

    Any help would be greatly appreciated!

    Cheers.

     

     

     

  • Daniel.S 50 posts 135 karma points
    Jul 31, 2009 @ 02:12
    Daniel.S
    0

    Did you insert it through the 'Insert Macro' button in the rich text editor?

    Have you checked the properties of that particular macro to ensure that it's able to be used/displayed in the RTE?

  • urg 5 posts 23 karma points
    Jul 31, 2009 @ 16:34
    urg
    0

    Hi Daniel,

    I have tried the insert button and with 'Display in Editor' checked and then again not checked to see if that was the case.

    The macro does display in the editor but only displays the

    <?UMBRACO_MACRO width="200" location="test.flv" macroAlias="FlvPlayer" height="200" /> 

    on the page. I have tried different macros and all come out as a version above.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 31, 2009 @ 17:07
    Jan Skovgaard
    0

    Hey urg

    Which version of Umbraco are you using? If remember correctly there can be some issues with macros in the RTE in Umbraco 3.x.x

    /Jan

  • Bert 128 posts 251 karma points
    Aug 03, 2009 @ 10:52
    Bert
    0

    I got the same issue. The macro displays fine in every possible way except when I use it in the TinyMCE and then put in on the page through XSLT.

    Disabling output escaping just renders nothing. Enabling it renders:

    
    <?UMBRACO_MACRO macroAlias="someMacro" /> 
    
    

    The macro renders in templates, and when the tinyMCE is displayed through the item field. When the tinyMCE field is called through XSLT to display, this bug occurs.

    http://umbraco.codeplex.com/WorkItem/View.aspx?WorkItemId=21728
    http://forum.umbraco.org/yaf_postst8677_XSLT-Macro-not-rendering-to-page.aspx

    So until it get fixed you should find another way to get to your goal

  • Jonas Høiby 62 posts 53 karma points
    Jan 11, 2010 @ 16:16
    Jonas Høiby
    0

    i am having similar problems with the RTE and macros ...

    Think this is a major issue with newer versions of umbraco that should have a top priority in getting fixed ..

    and yes - i have done my bit of trying to figure out what the problem might be .. :s

  • Jonas Høiby 62 posts 53 karma points
    Jan 11, 2010 @ 16:17
    Jonas Høiby
    0

    umbraco v 4.0.3 (Assembly version: 1.0.3625.27276)

  • Thomas Vestergaard 52 posts 138 karma points
    Dec 23, 2011 @ 23:45
    Thomas Vestergaard
    0

    Has this been resolved?
    I'm running umbraco v 4.7.0 (Assembly version: 1.0.4090.38017) and this issue is still in play.

    My setup is:

    Template ->
    XSLT macro that outputs some content from the current node AND loads a specific node from elswhere in the content hierachy. ->
    The node loaded has a richtext field which contains a macro. This macro is not rendered.

    If i put the macro directly on the template, the macro renders. However this does not solve my problem. It HAS to render inside the richtext field.

    thanks.

    /Thomas

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 23, 2011 @ 23:58
    Jan Skovgaard
    1

    Hi Thomas

    Is the macro inside your RTE based on a XSLT file or is it based on a Razor file or user control? Just for the record this issue is not a bug :)

    If it's based on a XSLT file you should probably use umbraco.library:RenderMacroContent() to render the content from your RTE field.

    Hope this helps.

    /Jan

  • Thomas Vestergaard 52 posts 138 karma points
    Dec 24, 2011 @ 00:00
    Thomas Vestergaard
    0

    Hi Jan, your always on the spot ;) Are you not supposed to be celebrating cristmas or something? :)

    It's an XSLT file. I'll take a look at umbraco.library:RenderMacroContent() right away.

    /Thomas

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 24, 2011 @ 00:13
    Jan Skovgaard
    0

    Haha, well Christmas is still a couple of ours away, isn't it? ;-)

    But you're right, time to sign off and enjoy the holidays. Hope you figure it out.

    /Jan

  • Thomas Vestergaard 52 posts 138 karma points
    Dec 24, 2011 @ 00:20
    Thomas Vestergaard
    0

    Worked perfectly.

    So, what didnt work for me before was in my XSLT:
    <xsl:value-of disable-output-escaping="yes" select="comment_content"/>

    where comment_content was a richtext field that had a macro on it, and the macro didnt render. If I change the line above to:
    <xsl:value-of select="umbraco.library:RenderMacroContent(comment_content, @id)" disable-output-escaping="yes"/>

    Everything works like a charm.
    Jan, I cannot thank you enough :)


    All the best
    Thomas

Please Sign in or register to post replies

Write your reply to:

Draft