Copied to clipboard

Flag this post as spam?

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


  • Sherry Ann Hernandez 320 posts 344 karma points
    Nov 02, 2010 @ 14:30
    Sherry Ann Hernandez
    0

    How to get recursive property values in usercontrol

    Hi,

    Is there a way to get the property values recursively in usercontrol?

    Thanks,

    Sherry

  • Eduardo 106 posts 130 karma points
    Nov 02, 2010 @ 14:51
    Eduardo
    0

    Hi Sherry,

    Do you mean the properties you create in the macro?

    Sincere regards,
    Eduardo Macho

     

  • Sherry Ann Hernandez 320 posts 344 karma points
    Nov 02, 2010 @ 15:53
    Sherry Ann Hernandez
    0

    Hi Eduardo,

    I'm referring to the property that I created on the document type. :D

    Sherry

  • Eduardo 106 posts 130 karma points
    Nov 02, 2010 @ 15:58
    Eduardo
    0

    Hi Sherry,

    Can you tell me what you intend to do? So I could find an appropiate solution.

    SIncere regards,
    Eduardo

  • Tom Fulton 2030 posts 4996 karma points c-trib
    Nov 02, 2010 @ 17:06
    Tom Fulton
    0

    kipusoep wrote some C# helper methods he detailed in a blog post, and one of them is GetPropertyValueRecursive, which should do the trick

    http://tech.kipusoep.nl/wp-content/uploads/2010/07/UmbracoExtensions.cs_.txt

    from: http://tech.kipusoep.nl/2010/07/23/umbraco-45-visual-studio-2010-dotless-jquery-vsdoc-squishit-masterpages/

     

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    Nov 02, 2010 @ 17:20
    Jeroen Breuer
    1

    You can also pass a recursive property as a parameter to you macro:

    <umbraco:Macro Language="[$language]" Alias="Menu" runat="server"></umbraco:Macro>

    This is used on a content page while the language property is defined on the home (highest) node.

    Jeroen

  • arviman 71 posts 92 karma points
    Nov 02, 2010 @ 19:21
    arviman
    0

    If you mean, how to pass a property as a parameter to an xslt macro, you can do it like the following:

    Here contentProperty is the name of the parameter of the macro, and the property of the document type i'm passing is "MainContent"


    <umbraco:Macro ID="Macro1" contentProperty="MainContent" Alias="ContentBox" runat="server"/>

    You can then get the value of the property using:

    <xsl:variable name="contentProperty" select="/macro/contentProperty"/>

    <xsl:value-of select="$currentPage/data [@alias=$contentProperty]" disable-output-escaping="yes" />

  • 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