Copied to clipboard

Flag this post as spam?

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


  • jwijnker 7 posts 27 karma points
    Mar 23, 2011 @ 09:50
    jwijnker
    0

    PropertyTypePicker as Macro Parameter

    Guys,

    in a template i call a macro where i want to use a DocType PropertyValue as parameter.
    TEMPLATE:

    <div>
    <umbraco:Macro LinkId="MoreInfoLink" Alias="LinkURL" runat="server"></umbraco:Macro>
    </div>

    In the macro/XSL 'LinkURL', when i want to use the LinkId parameter i get the text 'MoreInfoLink' (the propery-name) instead of the LinkId (int).

    MACRO:

    <xsl:copy-of select="/macro/LinkId" />  <!-- Gives "MoreInfoLink" instead of 1378 ex. -->

    Can anyone help me with this?

  • Michael Latouche 504 posts 819 karma points MVP 3x c-trib
    Mar 23, 2011 @ 10:03
    Michael Latouche
    0

    Hello,

    I think for this you have to use the following syntax to indicate you want the value of the property, not the string passed:

    <umbraco:Macro LinkId="[#MoreInfoLink]" Alias="LinkURL" runat="server"></umbraco:Macro>

    Hope this helps.

    Cheers,

    Michael.

  • jwijnker 7 posts 27 karma points
    Mar 23, 2011 @ 10:17
    jwijnker
    0

    Michael,

    thanks for you're quit reply! It works fine.
    Now the most important thing...

    Where can i find that information/documentation which says "[#variable]" is the variable's value... and more so i don't have to spam the forum?

  • Michael Latouche 504 posts 819 karma points MVP 3x c-trib
    Mar 23, 2011 @ 10:28
    Michael Latouche
    0

    Glad it helped you, and good question ;-)

    Well, if an initial search on the site with the global search does not give anything helpful (it's not always easy to determine the best search terms...), you might want to have a look at the wiki pages.

    For example, the macro info can be found at http://our.umbraco.org/wiki/reference/templates/umbracomacro-element, and, more specifically for the [#...] and other special notations, at http://our.umbraco.org/wiki/reference/templates/umbracomacro-element/macro-parameters/advanced-macro-parameter-syntax.

    Also, can you maybe mark my previous post as "answer", to help others who look for similar problems?

    Thanks!

    Cheers,

    Michael.

Please Sign in or register to post replies

Write your reply to:

Draft