I have a call to a snippet:
[[+youtubevideo:!empty=`[[!ShowYouTubeClip? &clip=`[[+youtubevideo]]` ]]` ]]
The problem is that the youtubevideo parameter can contain odd characters like question marks, the snippet will not execute if it sees these.
Tried surrounding it in quotes - even before it was passed to the placeholder, still does not work.
How can I pass a url that looks like this:
http://www.youtube.com/watch?v=x9AwgIkSReI&feature=related to a snippet
-thanks
-sean
*** Not just websites, we also create signage, banners, print, trade show displays and more! ***
Sean Kimball CLP, CLS.
Technical Director / Sr. Developer | BigBlock Studios
._______________________________________________.
Bigblock Studios
http://www.bigblockstudios.ca Web site design & development.
27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
phone/fax: 905-426-5525
I think that would work in Revolution, but in Evolution, you need to use some other characters or character combinations for the illegal characters in the snippet tag and then use str_replace in the snippet to convert them back.
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html
Thanks guys;
I wound up doing something like this [since there are several different formats of clip a user may enter!]
<?php
$clip = str_replace('QUERY','?',$clip);
// short url
if(stristr($clip,'youtu.be/')){
$video = explode('.be/',$clip);
$video =$video[1];
$videoclip = 'http://youtube.com/v/'.$video.'?version=3&hl=en_US';
}
// pasted url
if(stristr($clip,'watch?v=')){
$querystring = explode('?',$clip);
$video = explode('&',$querystring[1]);
$video = str_replace('v=','',$video[0]);
$videoclip = 'http://youtube.com/v/'.$video.'?version=3&hl=en_US';
}
// default old url version
if(stristr($clip,'/v/')){
$videoclip = $clip;
}
$youtubevideo = array();
$youtubevideo['videoclip'] = $videoclip;
$output = $modx->getChunk('YouTubeVideoTpl',$youtubevideo);
return $output;
*** Not just websites, we also create signage, banners, print, trade show displays and more! ***
Sean Kimball CLP, CLS.
Technical Director / Sr. Developer | BigBlock Studios
._______________________________________________.
Bigblock Studios
http://www.bigblockstudios.ca Web site design & development.
27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
phone/fax: 905-426-5525