I have a website running in Umbraco 4.7, I'm using the Business Starter Kit and the uMedia skin. The Business Starter Kit has a u.mediaSliders document type which stores banners for a slider.
I have implemented the same functionality for a Portfolio Slider. This Portfolio Slider shows banners for project which I have done or participated in. This is my document tree:
But the problem is that my Portfolio Slider isn't showing on my Portfolio page. It must be a problem with the xslt-code. This is the line that accesses the Portfolio Sliders node:
$currentPage/parent::*[@isDoc]/*[@isDoc and name() = 'Portfolio Sliders']
From the current page ('Portfolio') you go up one page (parent::*[isDoc], isDoc makes sure that you get only real nodes and not property/data fields), and then select the node named 'Portfolio Sliders' (*[@isDoc and name() = 'Portfolio Sliders']). Since the name might change pretty quickly it's safer to use the doc type on that (and if you have only one of these on that level):
The only thing that I noticed, is that when I add a new portfolioSlider node, I have to republish the document tree before it is rendered in the webbrowser.
problem with xslt
Hi,
I have a website running in Umbraco 4.7, I'm using the Business Starter Kit and the uMedia skin. The Business Starter Kit has a u.mediaSliders document type which stores banners for a slider.
I have implemented the same functionality for a Portfolio Slider. This Portfolio Slider shows banners for project which I have done or participated in. This is my document tree:
But the problem is that my Portfolio Slider isn't showing on my Portfolio page. It must be a problem with the xslt-code. This is the line that accesses the Portfolio Sliders node:
<xsl:variable name="sliderNode" select="$currentPage/parent::*/child::*[@level=1]/portfolioSliders"/>
But this doesn't work. The thing is that I don't know how I can access a node that is on the same level in the hierarchy as the current node.
Does anybody know how I can access the Portfolio Sliders node from my Portfolio page?
Thanks for your help,
Anthony
Belgium
Hi Anthony,
try this:
From the current page ('Portfolio') you go up one page (parent::*[isDoc], isDoc makes sure that you get only real nodes and not property/data fields), and then select the node named 'Portfolio Sliders' (*[@isDoc and name() = 'Portfolio Sliders']). Since the name might change pretty quickly it's safer to use the doc type on that (and if you have only one of these on that level):
Hope that helps,
Sascha
Hi Sasha,
Thanks for your help, I tried your code, but it doesn't work.
If I try this code:
<xsl:variable name="sliderNode" select="$currentPage/parent::*/child::*[@level=2]"/>
It does work.
The only thing that I noticed, is that when I add a new portfolioSlider node, I have to republish the document tree before it is rendered in the webbrowser.
greetings,
Anthony
Belgium
is working on a reply...