Notice the "node" element in there? Since you're using version 4.6.1 you are using the new XSLT syntax, which you have been doing in the whole file but in that line there is a reference to "node", which should probably NOT be there :-)
Jan's right, you should replace node with the alias of the media type you are expecting, so /macro/StartNode/folder/@id should work
...however, are you sure it's "folder" and not "Folder"? I see that your HTML output is lowercase but not sure how, the default media type is "Folder".
What you also might try is just replacing it with * to handle any media type, ex:
Our Umbraco host provider has just experienced a minor hack on their system and I still havin' trouble getting XSLTsearch to work again (the .cs file can't run!?)
That's good to hear. You have probably had the right idea but perhaps there has been one of those hard-to-catch typos that can drive one nuts. And of course if there is something going on on the server it can also confuse things of course.
mediaCurrent on image folder (4.6.1)
Hi All,
After searching through the forum and googling for hours I give up.
Mission: output a img tag for all images in a media folder - as many do.
I simply cannot get the folder id from a mediaCurrent parameter through xslt.
So:
Parameter: StartNode created and checked "show" and selecting mediaCurrent as type.
My script works perfectly using the hardcoded version:
<xsl:variable name="StartNode" select="2361" />
But changing it to will not give any output (or id of the folder):
<xsl:variable name="StartNode" select="/macro/StartNode/node/@id" />
$StartNode is blank if I do a value-of.
If I do:
<xsl:copy-of select="/macro/StartNode" />
html output is:
So it tells me that StartNode contains valid info.
Have also tried this (with a value-of):
Which doesn't work either. I've followed all things from BlackPoint without any luck.
Maybe there's something funny about the 4.6.1 or just me!
Thanks!
/Brian
Hi Brian
I think the problem is with this line
<xsl:variable name="StartNode" select="/macro/StartNode/node/@id" />
Notice the "node" element in there? Since you're using version 4.6.1 you are using the new XSLT syntax, which you have been doing in the whole file but in that line there is a reference to "node", which should probably NOT be there :-)
Does it help to remove it?
/Jan
Hej Jan,
Thanks for you reply.
That didn't work either so I would be(?):
<xsl:variable name="StartNode" select="/macro/StartNode/@id"/>
Just empty ..... sooo strange!
According to BlackPoint 4.0 -> 4.5 converter there should be no difference between the two version on how this should be written.
/Brian
Hi Brian...
Hmm...does the StartNode alias exist on the parameter? And if so...does it in fact have a value?
/Jan
Hi Brian,
Jan's right, you should replace node with the alias of the media type you are expecting, so /macro/StartNode/folder/@id should work
...however, are you sure it's "folder" and not "Folder"? I see that your HTML output is lowercase but not sure how, the default media type is "Folder".
What you also might try is just replacing it with * to handle any media type, ex:
Hope this helps,
Tom
Hi Jan,
Yes, otherwise I would not be able to get any output of the StartNode "copy-of" (see the above html output) which states the correct folder id (2361).
I'm inserting the macro in tiny mce which gives this html:
So umb_startnode is there and passed on to xslt.
/Brian
Tom,
Tried that - still the same - no output.
If I use the /*/@id then I get an error when loading the page:
Error parsing XSLT file: \xslt\FadePictures.xslt
/Brian
Hmm *scratches head*
I just tested this on a 4.6.1 install and it worked perfectly using mediaCurrent as the parameter with a Folder selected
Just for kicks can you try getting rid of all your other code temporarily and just write that out and see if you get the ID?
Otherwise maybe verify your xml again with
<textarea><xsl:copy-of select="/macro/StartNode"/></textarea>
Other than that I'm a bit stumped :)
-Tom
Solved!
I can't explain what just happened - but this worked now (very sure I have tried this before):
<xsl:variable name="StartNode" select="/macro/StartNode/Folder/@id"/>
And also the /*/@id worked
Our Umbraco host provider has just experienced a minor hack on their system and I still havin' trouble getting XSLTsearch to work again (the .cs file can't run!?)
So maybe they did something on the server...
Thanks guys for all your help!
/Brian
Hi Brian
That's good to hear. You have probably had the right idea but perhaps there has been one of those hard-to-catch typos that can drive one nuts. And of course if there is something going on on the server it can also confuse things of course.
But glad you're able to move on :-)
/Jan
i know this is an old post, but i have been struggling with this for the last few hours, but i found a solution which may help others.
i have a macro for use in an RTE, with a parameter called mediaFolder which is of the mediaCurrent variety.
after trying countless variations, when ever i request the id, i got nothing back. UNTIL i used 'string()' as below:
<xsl:param name="imgs" select="string(/macro/mediaFolder/Folder/@id)"/>
Hope this helps someone else....
is working on a reply...