Copied to clipboard

Flag this post as spam?

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


  • Profiterole 232 posts 264 karma points
    Jul 12, 2010 @ 20:48
    Profiterole
    0

    "bodyText of a certain node" doctype

    Hi, my tree looks like this :

    Homepage

      - Section 1

        -- sub 1.1

        -- sub 1.2

      - Section 2

       -- sub 2.1

       -- sub 2.2 (which is the same content as 1.2)

    I'd like to create a doctype that will refer to a certain node and copy its bodyText. In my tree, the bodyText of sub1.2 and sub2.2 is the same. So, if I change the text in 1.2, I'd like the text in 2.2 changes as well. How can I acheive that in a simple way for my users?

    Thank you

  • webangelo 107 posts 190 karma points
    Jul 12, 2010 @ 21:13
    webangelo
    1

    If you put a content picker on the documentType to select the content you want to get the bodyText from, you could create a quick XSLT macro to return the bodyText value from that page using the umbraco.library:GetItem(nodeId,alias) method.

    http://our.umbraco.org/wiki/reference/umbracolibrary/getitem

    Alternatively, if you stored the content in the parent node (i.e. The section Node in the tree structure above) you could use a recursive reference to the bodyText field directly in the template instead.  (Easiest way is to select the checkbox for recursive when inserting a data field into a template).

  • Dirk De Grave 4537 posts 6006 karma points MVP 3x admin c-trib
    Jul 12, 2010 @ 22:45
    Dirk De Grave
    0

    Agree with webangelo, if you have lots of data that needs to be reused on different pages, consider moving that data to a node and use xslt, macro to get the contents of that data node

     

    Cheers,

    /Dirk

  • Lee Kelleher 3945 posts 15163 karma points MVP 10x admin c-trib
    Jul 12, 2010 @ 22:49
    Lee Kelleher
    0

    Hi Profiterole,

    Take a look at using the umbracoInternalRedirectId property - assign it to a content picker.  That way you can associate content, but have the flexibility to apply a different template, etc.

    Cheers, Lee.

  • Profiterole 232 posts 264 karma points
    Jul 13, 2010 @ 07:49
    Profiterole
    0

    Thank you guys, Lee's trick with the property works like a charm!

  • 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