Plugin

Developer
Supported

URL Tube

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Mark Spurlock

     

You must be logged in to post.

Url only

General

Reinos
Reinos

Hi Mark,

Is it possible to output only the url with a param

return_url="yes" 

Something like this:

//output markup to the template
            
if ($site == 'youtube'{
                
if($this->EE->TMPL->fetch_param('url_only') == 'yes')
    
{
     $this
->return_data "$protocol://www.youtube.com/embed/$video_id$query_string";
    
}
    
else
    
{
     $this
->return_data "<iframe width='$w' height='$h$sel src='$protocol://www.youtube.com/embed/$video_id$query_string'
                     frameborder='0' allowfullscreen></iframe>"
;
    
}

                
            } 
else if ($site == 'vimeo'{
    
if($this->EE->TMPL->fetch_param('url_only') == 'yes')
    
{
     $this
->return_data "$protocol://player.vimeo.com/video/$video_id$query_string";
    
}
    
else
    
{
                 $this
->return_data "<iframe src='$protocol://player.vimeo.com/video/$video_id$query_string' width='$w' height='$h'
                     frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>"
;
    
}
            } 

 

Spurlock
# 1
Developer
Spurlock

Hi Reinos,

Currently URL Tube doesn’t have a feature like this. I’m always open to feature requests, but I’m not sure I understand the purpose of what you’re asking about.

URL Tube’s input is always some video URL, so if that’s all you need you could simply not use URL Tube at all.

It seems like you’re trying to get the src attribute that you’d need for an embed iframe, but without the actual iframe code. If so, what for?

Or perhaps you’re just trying to normalize the way URLs are output?