Copied to clipboard

Flag this post as spam?

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


  • Rahul Kumar Singh 2 posts 22 karma points
    May 29, 2013 @ 10:55
    Rahul Kumar Singh
    0

    Find the page name from id, passed by content picker

    Hello,

    I have content picker property on a document type. I want to create a link in the macro by passing the id which is selected by the user. How should i proceed. I have alias name for the content picker as "imageLink1". I want to create a link via macro using xslt. The macro is parameterized and alias name for parameter is "moreInfoId".

    <umbraco:Macro moreInfoId="<umbraco:Item field="imageLink1" runat="server" />" Alias="GetHomeAdvertLink" runat="server"></umbraco:Macro>

     

    I want this macro to return a link with the nodename. Please guide, what will be my xslt for this. Thanks a lot

  • Laurence Gillian 600 posts 1219 karma points
    May 29, 2013 @ 18:00
    Laurence Gillian
    0

    If you wish to pass a parameter into a macro you should use the following syntax:

    [#PageTitle] = get propertyAlias
    [$PageTitle] = get propertyAlias Recursivly
    [@yourQueryString] = get request collection, e.g. a query string
    [%cookieName] = get cookie 

    <umbraco:Macro moreInfoId="[#imageLink1]" Alias="GetHomeAdvertLink" runat="server"></umbraco:Macro>
    

    Reference: https://github.com/umbraco/Umbraco4Docs/blob/master/Documentation/Reference/Templating/Macros/index.md

    XSLT and Macro Parameters Super Star Speedy Guide :)

    http://our.umbraco.org/wiki/reference/templates/umbracomacro-element/macro-parameters

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies