Video Embed with PrettyPhoto - How to link to YouTube through xslt
I was previously using prettyphoto to play a flv file stored in our media folder. However these files do not play on iPhone, iPad so we decided to go with embedding YouTube videos using the Video Emped package. I am very new to xslt and trying to change this existing code to play the video through PrettyPhoto. Currently we have it set up so that there is a main video page that displays the video thumbnails in a grid. Once you add a new video node under the video main page, it displays in the video main page as a thumbnail and you are able to click it and it plays in the prettyphoto lightbox.
The current xslt for linking to the media folder video (flv) using pretty photo is as follows for the video main page:
I know that the prettyphoto plugin plays youtube videos, I just don't know how to do this with xslt. Video Embed accepts the the video URL through datatype video embed (alias=videoLink in doctype). The prettyphoto hard codes the link to the youtube video as follows:
Any recommendations would be greatly appreciated. Maybe there is another way to display a group of YouTube videos on one page. I am currently trying to work with what I already have.
From your description above I'm thinking you should be able to have a field based on a textstring to hold the url to either Vimeo or Youtube so you can fetch the url using XSLT from your current page.
So in your XSLT file you could write something like <a href="{$currentPage/videoLink}"></a> - Does this make any sense to you?
The video main node displays a list of all the video child nodes (this is where the videoLink field is located). I am not sure the path is correct for the videoLink location, should it be the child node of the current page (the current page would be the video main node and the child nodes would be where the videoLinks are entered). Should I just use a text field datatype instead of the embed datatype that comes with the embed plugin? Currently it looks like the embed datatype is pushing out an id number. I tried to convert it to a string but I think the syntax was off. This is what I had and it is not working:
Video Embed with PrettyPhoto - How to link to YouTube through xslt
I was previously using prettyphoto to play a flv file stored in our media folder. However these files do not play on iPhone, iPad so we decided to go with embedding YouTube videos using the Video Emped package. I am very new to xslt and trying to change this existing code to play the video through PrettyPhoto. Currently we have it set up so that there is a main video page that displays the video thumbnails in a grid. Once you add a new video node under the video main page, it displays in the video main page as a thumbnail and you are able to click it and it plays in the prettyphoto lightbox.
The current xslt for linking to the media folder video (flv) using pretty photo is as follows for the video main page:
<a rel="prettyPhoto" href="{umbraco.library:NiceUrl(@id)}?iframe=true&width={videoWidth}&height={videoHeight}">
I know that the prettyphoto plugin plays youtube videos, I just don't know how to do this with xslt. Video Embed accepts the the video URL through datatype video embed (alias=videoLink in doctype). The prettyphoto hard codes the link to the youtube video as follows:
<a href="http://www.youtube.com/watch?videocode" rel="prettyPhoto" title=""><img src="images/thumbnails/flash-logo.jpg" alt="YouTube" width="60" /></a>
Any recommendations would be greatly appreciated. Maybe there is another way to display a group of YouTube videos on one page. I am currently trying to work with what I already have.
Thank you.
Hi Kristin
From your description above I'm thinking you should be able to have a field based on a textstring to hold the url to either Vimeo or Youtube so you can fetch the url using XSLT from your current page.
So in your XSLT file you could write something like <a href="{$currentPage/videoLink}"></a> - Does this make any sense to you?
Looking forward to hearing from you.
/Jan
Hi Jan,
The video main node displays a list of all the video child nodes (this is where the videoLink field is located). I am not sure the path is correct for the videoLink location, should it be the child node of the current page (the current page would be the video main node and the child nodes would be where the videoLinks are entered). Should I just use a text field datatype instead of the embed datatype that comes with the embed plugin? Currently it looks like the embed datatype is pushing out an id number. I tried to convert it to a string but I think the syntax was off. This is what I had and it is not working:
<a rel="prettyPhoto" href="{$currentPage/child/::*/videoLink>
Thanks Jan
Hi Jan,
This worked! Thanks! I actually used this to specify the node that video link was on:
$currentPage/descendant-or-self::videoLink"
Thanks so much!
is working on a reply...