I want to be able to access/render a field of a specific node. Each child, grandchild etc of the homepage will have a 'Menu' field which will be used to populate a drop-down menu that will be available on every page. So, within an XSLT that'll be referenced from the template for every page there would be something like:
If I understand your question correctly you want to be able to show events on different pages?
If so this sounds like you could benefit from placing a content picker on your nodes. In that way you can pick the root of your events node and pass the value of that property to your XSLT and fetch the nodes by using for instance umbraco.library:GetXmlNodeById(). In here you'll pass the value of the content picker (which holds the id of the selected page) like this: umbraco.library:GetXmlNodeById($currentPage/yourcontentpickerpropertyname).
No. I have a main navigation displaying each of the main content sections/pages. When you roll over one of these a drop-down panel appears. I want to display some content on this panel that belongs to the relevant page. For example, the Events page has a 'Menu' tab that contains a 'Content' field. Whichever page the user is on, when they roll over the Events item in the menu I want the drop-down to display the Content field from the Menu tab of the Events page.
Basically, I want to be able to access a field of a specific page from any page or sub page.
Do I get this correct. What you're trying to do is make a mega dropdown menu like this http://www.sohtanaka.com/web-design/examples/mega-dropdowns/ but instead of nesting the other levels of navigation within it you want some text, which describes what is to be found in the section? Correct?
Yes, that's it. The drop-downs for most sections will contain dynamic content, but some of them need to contain content defined by the client. This will be input in a field in the Menu tab of the relevant page. So, the drop-down content for the Events page will reside in the 'Content' field of the 'Menu' tab of the Events page. I therefore need to be able to access this field from wherever I am in the site.
Get field of specific node
I want to be able to access/render a field of a specific node. Each child, grandchild etc of the homepage will have a 'Menu' field which will be used to populate a drop-down menu that will be available on every page. So, within an XSLT that'll be referenced from the template for every page there would be something like:
The pages in which the macro for this XSLT will sit could be the homepage itself, one of its children or grandchildren.
Hi Robin
If I understand your question correctly you want to be able to show events on different pages?
If so this sounds like you could benefit from placing a content picker on your nodes. In that way you can pick the root of your events node and pass the value of that property to your XSLT and fetch the nodes by using for instance umbraco.library:GetXmlNodeById(). In here you'll pass the value of the content picker (which holds the id of the selected page) like this: umbraco.library:GetXmlNodeById($currentPage/yourcontentpickerpropertyname).
I hope the above makes sense to you? :-)
/Jan
No. I have a main navigation displaying each of the main content sections/pages. When you roll over one of these a drop-down panel appears. I want to display some content on this panel that belongs to the relevant page. For example, the Events page has a 'Menu' tab that contains a 'Content' field. Whichever page the user is on, when they roll over the Events item in the menu I want the drop-down to display the Content field from the Menu tab of the Events page.
Basically, I want to be able to access a field of a specific page from any page or sub page.
I am new to this.
Hi Robin
Do I get this correct. What you're trying to do is make a mega dropdown menu like this http://www.sohtanaka.com/web-design/examples/mega-dropdowns/ but instead of nesting the other levels of navigation within it you want some text, which describes what is to be found in the section? Correct?
/Jan
Hi Jan
Yes, that's it. The drop-downs for most sections will contain dynamic content, but some of them need to contain content defined by the client. This will be input in a field in the Menu tab of the relevant page. So, the drop-down content for the Events page will reside in the 'Content' field of the 'Menu' tab of the Events page. I therefore need to be able to access this field from wherever I am in the site.
Hi Robin,
If you know the ID of the node you can use umbraco.library:GetXmlNodeById(id) to get the XML for that node.
Assuming you already have a for-each loop to write out your navigation items, you could put something like this in your for-each loop:
Or if you need to get several fields you can assign to a variable, ie
-Tom
is working on a reply...