Copied to clipboard

Flag this post as spam?

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


  • bev0 39 posts 59 karma points
    Jan 16, 2012 @ 19:17
    bev0
    0

    access another document type from a different parent

    to make it less confusing, i will provide an example.

    Content
    - Parents1
    +childContent1
    +childContent2
    - Parents2
    +childContent3
    +childContent4

    I am in a template of childContent3 but i want to access a field in Parents1. I know i can do this through XSLT but just simply through the template, what do i need to do to access that info ? please help

  • Sharon 16 posts 37 karma points
    Jan 16, 2012 @ 21:37
    Sharon
    0

    You could always use inline razor in the template, provided it's Umbraco 4.7.x

  • Tim 1193 posts 2675 karma points MVP 3x c-trib
    Jan 23, 2012 @ 16:43
    Tim
    0

    Hiya,

    Pretty much what @Sharon said. The best way to access something like this from directly within a template is probably using inline Razor. You MIGHT be able to do something using the techniques mentioned in this wiki article: http://our.umbraco.org/wiki/how-tos/xslt-useful-tips-and-snippets/using-inline-xslt-and-umbraco-library-to-manipulate-strings-from-umbraco-items and passing in the id of the page that you want to use and using the XSLT property to pass in the XSLT to get the property of the page that you're after.

    In general though, I'd recommend that functionality like this be kept in a Macro rather than added onto the template directly, just to keep things cleaner and easier to maintain.

Please Sign in or register to post replies

Write your reply to:

Draft