I am working on my new website ware I want to create a "playlist". The playlist should contain 7 urls for some mp3 files. The first and the last url is always the same, the middle 5 should be gathered from the top-five newest nodes that are childes to id=1103.
Well, first I upload the file to Umbraco. Then I make a page for the file with additional information and pick the file. On another page I want to present the five newest files.
Here's something that actually "works on my machine":
You'll have to replace the names in the first few lines (bolded for your convenience) with the names of the actual Doctype and propertyName you're using
Generate comma separated list of nodepropertys
Hi all!
I am working on my new website ware I want to create a "playlist". The playlist should contain 7 urls for some mp3 files. The first and the last url is always the same, the middle 5 should be gathered from the top-five newest nodes that are childes to id=1103.
Exsample of the final output:
After the list string i collected I will put it in to an audio player on the page.
Hi Webspas,
Is node Id "1103" a content or media node?
Either way, a simple XSLT macro can produce the output you need. Let us know the node type and we'll show you an example.
Cheers, Lee.
Hi Webspas,
I'd think something like this would be a good start:
/Chriztian
#Lee: Deal! :-)
"1103" is a page node.
By the way: I would like to use the list string somewhere else inside the same XSLT file.
Chriztian beat me to it! ;-) (XSLT legend!)
He - thought about asking that too, Lee - should have, I can see :-)
@Webspas: So is the file an "Upload" datatype, or a Media Picker?
Hi Webspas,
I've updated the code above, in case you might have used it as a starting point.
(There was a couple of "hurry-up, must. beat. Lee. post. now!" errors in the first draft :-)
/Chriztian
Well, first I upload the file to Umbraco. Then I make a page for the file with additional information and pick the file. On another page I want to present the five newest files.
Does that answer your question?
Hi again,
Here's something that actually "works on my machine":
You'll have to replace the names in the first few lines (bolded for your convenience) with the names of the actual Doctype and propertyName you're using
/Chriztian
Thank you very much! So far so good.
Now there is only one thing left, and as far I see it there are 2 possibilities:
The list that is created must be placed inside a Javascript in order to be played for the user. Can it be done by...
... or...
Or is there something else? I appreciate your replies!
Hi Webspas,
You can just wrap a variable instruction around the template body to create the result as a string for reuse later on, e.g.:
Also, change the output instruction and ask for CDATA output of script elements:
/Chriztian
Wuhoo! It's working!
I had never figured that solution out myself. Great thanks!
PS: The final work of this website will soon be released at www.thenoise.dk :-)
is working on a reply...