Perhpas you could also make sure that the link is always pointing to the second or third id in the @path attribute? (Or whatever place the id has in the path attribute).
This attributes contains a comma seperated list of nodeid's that makes up the path to the current node.
So by splitting the content of this attribute using umbraco.library:Split() you can always go to the correct id by writing something like...
Parent node link
Hi
I have this structure:
- News
-- 2011
--- news 1
--- news 2
-- 2010
--- news 4
--- news 5
-- 2009
On my frontpage I show both news from 2011 and 2010 - so how do i point them into the different pages (2011 and 2010).
So when you click on news 1 you go to the 2011 page and when you click on news 4 you go to the 2010 page?
It's my url3 i need to change to point to the parent of those news items.
Here's what i'm trying:
Hi Daniel
If you want the $url3 to contain a link to the parent node try this:
/Kim A
Hi Daniel
Perhpas you could also make sure that the link is always pointing to the second or third id in the @path attribute? (Or whatever place the id has in the path attribute).
This attributes contains a comma seperated list of nodeid's that makes up the path to the current node.
So by splitting the content of this attribute using umbraco.library:Split() you can always go to the correct id by writing something like...
<xsl:variable name="parent" select="umbraco.library:Split(@path,',')/values/value[2]" />
I hope this makes sense.
/Jan
Hi Daniel,
To get the url3 variable to point to the parent of the page you're currently at in the loop,
you should use current() instead of $currentPage - but in this case you can just ditch the
"$currentPage/" part. I *think* what you're aiming at is really something like Kim's suggestion,
but not using $currentPage - so effectively:
@Jan: Don't mess with the @path attribute - it's usually much better to use the ancestor-or-self:: axis to access those nodes.
/Chriztian
Hi Chriztian
Yes of course - just meant as an alternative solution :-)
/Jan
Holy smokes! How did I not notice that we where inside a loop :P
Yeah, of course you shouldn't use $currentPage then, but do like Chriztian says.
/Kim A
Thanks guys - you rock ! :)
is working on a reply...