Copied to clipboard

Flag this post as spam?

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


  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Mar 22, 2012 @ 15:38
    Hendy Racher
    0

    Advanced Macro Parameter Syntax with Razor

    Hi,

    Should the Advanced Macro Parameter Syntax work with Razor macros ?

    The following doesn't seem to pass any value:

    <umbraco:Macro id="listPdfsMacro" runat="server" Alias="ListPdfs" Pdfs="[#pdfs]" />

     

    Whilst I can do the following:

    <umbraco:Macro id="listPdfsMacro" runat="server" Alias="ListPdfs" Pdfs="pdfs" />

    and get the value out of the 'pdfs' property within the macro, but ideally would prefer to pass in the data, rather than a property alias to that data.

    Thanks,

    Hendy

     

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Mar 22, 2012 @ 15:41
    Tom Fulton
    0

    Hey Hendy,

    Pretty sure it works.

    What type of property is the 'pdfs' field?  Not sure if you are aware but Advanced Macro Parameter Syntax doesn't work with XML data - you'll need to pass the field alias instead and grab it from your macro if that's the case.

    -Tom

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Mar 22, 2012 @ 15:45
    Hendy Racher
    0

    Arrhhh, yes it's Xml data - could swap over to a Csv I suppose (since it's just a collection of node Ids, and not checking them with XPath)

    Thanks Tom :)

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Mar 22, 2012 @ 15:48
    Tom Fulton
    1

    No problem!  Also doing things this way you sort of lose support for the RazorDataTypeModels if you are using them - in case you're interested this thread has some ways to manually cast the string value to a RazorDataTypeModel.

    -Tom

Please Sign in or register to post replies

Write your reply to:

Draft