Copied to clipboard

Flag this post as spam?

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


  • Alex 79 posts 416 karma points
    May 13, 2016 @ 11:03
    Alex
    0

    Macro

    Hi all,

    how to add parameter in macro?

    thanks

  • Samira 113 posts 452 karma points
    May 13, 2016 @ 11:13
    Samira
    1

    Hi Alex,

    if you need to add a parameter for your macro you should add it in the "developer" section under the "Macro" folder. select the macro you want tom add the parameter and select parameter from parameter tab.

    hope this help

    Regards,

    Samira

  • Dennis Adolfi 1082 posts 6450 karma points MVP 6x c-trib
    May 13, 2016 @ 12:10
    Dennis Adolfi
    1

    Hi Alex. As Samira mentioned, and when you want to read your macro in a Marco Partial View, use:

    @{
    var parameter = @Model.MacroParameters["alias"].ToString()
    }
    

    Where "alias" is the alias defined for your macro parameter.

    Best of luck to you, let us know if there is any problems.

    https://our.umbraco.org/documentation/reference/templating/macros/Partial-View-Macros/

    Aslo, if you have Umbraco.tv subscription, here are a great tutorial: http://umbraco.tv/videos/implementor/working-with-umbraco-data/macros/setting-up-macro-parameters/documentation/ (Its for Umbraco 6, but it works the same way in Umbraco 7+)

  • 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