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?
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.
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).
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
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.
"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
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).
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
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.
Thank you guys, Lee's trick with the property works like a charm!
is working on a reply...