Copied to clipboard

Flag this post as spam?

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


  • dominik 711 posts 733 karma points
    Apr 11, 2011 @ 09:25
    dominik
    0

    Old macro parsing on Umbraco 4.5.2?

    Hello everybody,

    I am using Umbraco 4.5.2 and just put some macro into my content. What Umbraco does is very strange. It uses the old macro statement I think

    Here is the code:

    <?UMBRACO_MACRO ordertypeclass="order_button"
    type="Button" text="test"
    macroAlias="OrderingButton" />

    If I put the macro in some other content side it works.

     

  • dominik 711 posts 733 karma points
    Apr 11, 2011 @ 10:01
    dominik
    0

    So what the problem is exactly,

    I created a xslt for displaying some content in a "sidebar" - if I now put some content and a macro with the editor into this sidebar the content is rendered correct but the macro in the old way (just looked into the sourcode). How can i fix this issue so the macro is also rendered for umbraco 4.5.2?

    Thanks

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 11, 2011 @ 20:46
    Jan Skovgaard
    1

    Hi Dominik

    Do you insert the macro into a rich text editor?

    If that is the case you need to use either the GetItem extension or RenderMacro extesion to render the macro, which is inserted into the rich text editor.

    Does it make sense?

    /Jan

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Apr 11, 2011 @ 20:57
    Tom Fulton
    1

    Just to clarify, try using the RenderMacroContent function - this should output the RTE contents as well as rendering any macros inside

    <xsl:value-of select="umbraco.library:RenderMacroContent(yourPropertyAlias, $currentPage/@id)" disable-output-escaping="yes" />

    Replace yourPropertyAlias with however you are getting the richtext property (ie $currentPage/yourPropertyAlias etc)

    -Tom

  • dominik 711 posts 733 karma points
    Apr 12, 2011 @ 08:57
    dominik
    0

    Do i have to install any plugin to get it working?

    Yes i inserted the macro in RichText editor

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 12, 2011 @ 09:00
    Jan Skovgaard
    0

    Hi Dominik

    No, you don't need to install anything.

    Doesn't the example provided by Tom work for you?

    /Jan

  • dominik 711 posts 733 karma points
    Apr 12, 2011 @ 09:05
    dominik
    0

    I use the code and now the macro is rendered but not in the correct way - i think i am loosing my macro properties.
    so one property is for example a property called "text" which is the text for the button. if i use the method from Tom i am loosing this information and the name is not filled in.

    If i use it in the bodyText all is working ok so i think the macro works fine but not in another XSLT

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 12, 2011 @ 21:44
    Jan Skovgaard
    0

    Hi Dominik

    Could you please provide an example of the XSLT you're trying to render the content of your rich text editor with?

    /Jan

  • dominik 711 posts 733 karma points
    Apr 19, 2011 @ 15:03
    dominik
    0

    Hi Jan,

    Here is my xslt

                      <xsl:value-of select="umbraco.library:RenderMacroContent($currentPage/contentTab1Text, $currentPage/@id)" disable-output-escaping="yes" /> 

    Inside the contentTab1Text there is my other Macro. All is rendered but i am loosing the properties of the macro which is included in contentTab1Text

     

     

  • dominik 711 posts 733 karma points
    Apr 19, 2011 @ 15:14
    dominik
    0

    THis is the code which is generated if i not render the macro:

    <?UMBRACO_MACRO ordertypeclass="order_button_gene"
    text="Order Now" type="Button"
    macroAlias="GSYOrderingButton" />

    If I render it in the way i posted above the properties are lost

Please Sign in or register to post replies

Write your reply to:

Draft