Ok, then try to remove the check on @IsDoc - you can always use the old trick of making the <textarea><xsl:copy-of select="$yourvariable" /></textarea> to see what XML gets returned. Mr. Steinmeier himself have actually made a package to make this daunting task easier. I'm sure it can save you some time figuring it all out.
Otherwise the media iterator package could perhaps help you out. I think there is an XSLT file in it, which you can modify to your needs. Check it out :-)
Recursive property in XSLT
I have a property called DVoverskrift on my doc type called forside.
My tree is like this:
Forside
- Textpage
-- textpage
-- textpage
- Contact page
On all pages i need to use the property DVoverskrift which is set on Forside.
How do i do this?
Hi Daniel
You should be able to achieve this by using the ancestor-or-self axe...
So you would write something like this
<xsl:value-of select="$currentPage/ancestor-or-self::*[@isDoc]/DVoverskrift" />
Hope this helps.
/Jan
That worked Jan, thanks! :)
How about pulling a media item recursively? Same scenario.
Hi Daniel
Yes it should be the same scenario - are you having trouble?
/Jan
If I've got it right, then isDoc checks if its a document (node?) and the media item isn't - so that's one problem.
Ive tried a few things but nothing is really working out - so how would you pull out a media item? :)
Hi Daniel
Ok, then try to remove the check on @IsDoc - you can always use the old trick of making the <textarea><xsl:copy-of select="$yourvariable" /></textarea> to see what XML gets returned. Mr. Steinmeier himself have actually made a package to make this daunting task easier. I'm sure it can save you some time figuring it all out.
Otherwise the media iterator package could perhaps help you out. I think there is an XSLT file in it, which you can modify to your needs. Check it out :-)
/Jan
Thanks for you reply Jan!
<xsl:variable name="url" select="$currentPage/ancestor-or-self::*[@isDoc]/nBLink"/>
Gives me the nodeid 1156 of the media item.. hmm
Hi Daniel
Yup, that's correct. It returns the id of the media node.
You need to pass that id to the GetMedia() extension, which you can read more about here: http://our.umbraco.org/wiki/reference/umbracolibrary/getmedia
I think that you should be able to figure out how to go on when you have seen the example on the page.
Otherwise just let us know, right? ;-)
/Jan
Thanks Jan - I'm gonna owe you are couple of beers at codegarden :)
You're very welcome. I'm only happy to be able to help.
Aaah, free beer just tastes better :D
/Jan
is working on a reply...