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
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.
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
You could always use inline razor in the template, provided it's Umbraco 4.7.x
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.
is working on a reply...