Copied to clipboard

Flag this post as spam?

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


  • jigar 170 posts 233 karma points
    Jul 01, 2009 @ 13:42
    jigar
    0

    How can I access parent node value in template of child node?

    Hello All,

    Thanks for your replies till now.

    I have question and I really stuck here.

    What my question is that how can I access parent node value in template of child node?

    Lets say News is having a property called News publish date, so in news template I can use it this way.

    <umbraco:Item field="PublishDate"
     runat="server"></umbraco:Item>,

    At the same time I have news item lets say News1 and on that I want to print value of NewsPublish date that derives from parent node [E.g News].

    Please let me know how can I do that?

    Regards

    Jigar

     

     

      </span>

     

  • dandrayne 1138 posts 2262 karma points
    Jul 01, 2009 @ 14:17
    dandrayne
    1

    Add recursive="true" to the property, or use xslt

    <umbraco:Item field="PublishDate" recursive="true" runat="server"></umbraco:Item>

    or

    <xsl:value-of select="$currentPage/../data [@alias='publishDate'] />

     

  • jigar 170 posts 233 karma points
    Jul 02, 2009 @ 09:14
    jigar
    0

    Thansk mate.. This is works fine.

     

    Now what is want is that i want to use this property in <asp-form> tag.

    Let me explain in detail.

    Normally when we want to pass any value to user control we write some thing like

    <ASPNET_FORM>
                <umbraco:Macro Alias="SendMail" runat="server" EmailBody="[#EmailBody]" >   </umbraco:Macro>
    </ASPNET_FORM>

    and  the above code will find "EmailBody" property from the content and send it to User control. This works fine.

     

    Now what i want is that the EmailBody is there in parent node and i want to send it user control. than how can i do that?

    Please reply.

    Regards

    Jigar

     

  • dandrayne 1138 posts 2262 karma points
    Jul 02, 2009 @ 11:53
    dandrayne
    1

    Perhaps inline xslt is your friend in this case? ->  http://umbraco.org/documentation/books/inline-xslt

  • 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