Get Property from Home Node, use it on Content Page
Hello,
I am trying to get some values from my "Home Node" properties.
On everypage there is a sidebar, and I need to set up some video attributes based on some properties set on the home node. The home node is a different document type than that of the content pages (with sidebar).
I wrote a XSLT file to get the values and pass them to my template on which they will be used in another macro to render the videos.
<div class="callout"> <h3>ensemble videos</h3> <ul> <li> <!-- here is where i need to get the value of the "GetVideo1" macro and pass it into this macro where VideoID is.--> <umbraco:Macro VideoID="" VideoThumbnailURL="" Alias="HomepageGallery" runat="server"></umbraco:Macro> </li> </ul> <a href="/video-galleries" title="view more ensemble videos">view more videos »</a>
To get the home node you can do like this <xsl:variablename="homeNode"select="$currentPage/ancesor-or-self::node [@level=1]"/> and try moving this line <umbraco:Macro Alias="GetVideo1"runat="server"></umbraco:Macro> within the li block.
Get Property from Home Node, use it on Content Page
Hello,
I am trying to get some values from my "Home Node" properties.
On everypage there is a sidebar, and I need to set up some video attributes based on some properties set on the home node. The home node is a different document type than that of the content pages (with sidebar).
I wrote a XSLT file to get the values and pass them to my template on which they will be used in another macro to render the videos.
Here is what I have done so far.
Now 2986 is the Home Node.
video1NodeID is a string value of the "VideoNode"
On my template I currently have
I am fairly stuck and kinda new to XSLT.
Current version is 4.0.2.1
Thanks,
Owen
Hi Owen,
Instead of passing the value of one macro to another through a template, is it possible to just use that code within the 'HomepageGallery' macro?
What is the HomepageGallery macro? An xslt, ascx, or other?
- Sean
Hi Owen
To get the home node you can do like this <xsl:variable name="homeNode" select="$currentPage/ancesor-or-self::node [@level=1]"/> and try moving this line <umbraco:Macro Alias="GetVideo1" runat="server"></umbraco:Macro> within the li block.
Hope this helps
Thanks
Pnima
is working on a reply...