Copied to clipboard

Flag this post as spam?

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


  • suzyb 474 posts 932 karma points
    Oct 11, 2012 @ 11:41
    suzyb
    0

    Default node IDs for RenderTemplate control

    I'm using the RenderTemplate control to output widgets on a page, small panels of content that should appear on the left column of pages.

    At the moment I have the following code to pull the widget information from the page (the macro uses the uComponents RenderTemplate control).

    <umbraco:Macro CurrentPage="" CustomProperty="" DocTypeAliasesToUseAltTemplate="" EntriesPerPage="" NodeIds="[#leftContentWidgets]" AltTemplateId="" UseChildNodes="" ExcludeDocTypesForChildNodes="" Alias="RenderWidgets" runat="server"></umbraco:Macro>

    I'd like to be able to have a default list of widget Node IDs however, set in a Settings page.  Is it possible with this macro.

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Oct 11, 2012 @ 12:16
    Lee Kelleher
    0

    Hi Suzy,

    Sure thing.  With the "NodeIds" attribute you can comma-separate additional values, like so:

    NodeIds="[#leftContentWidgets],[#defaultWidgets],1111"

    Unfortunately since the fallback values are comma-separated, you can't add a value that contains commas! :-$  So the best option would be to have a property on your DocType that contains the default node IDs.

    Good luck!

    Cheers, Lee.

  • Anthony Southworth 46 posts 173 karma points
    Oct 12, 2012 @ 17:27
    Anthony Southworth
    0

    Hi Suzy,

    I use this macro to display widgets, if no widgets are added to the current page they are inherited from a parent node. This way all sections can have a default list of widgets which you can override: 

    <umbraco:Macro runat="server" Alias="RenderWidget" NodeIds="[$sideWidgets]" CurrentPage="1" EntriesPerPage="10" AltTemplateId="0" UseChildNodes="0" />

    Cheers
    Tony

     

  • Craig Cronin 304 posts 503 karma points
    Apr 02, 2013 @ 22:25
    Craig Cronin
    0

    Hi All,

    I have a similar situation, but the solution above doesnt quite work for me.  I kind of want [#leftContentWidgets] but not on the current page.  I think the example above either looks at fields on the current page or hard coded node id's.

    Is there a way to point the nodeid's to a field on another node "settings node for instance"?

Please Sign in or register to post replies

Write your reply to:

Draft