Jump to:

10845 Posts in 2516 Topics by 1792 members

All other Modules

SilverStripe Forums » All other Modules » Youtube gallery make video embeded...

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 857 Views
  • raamklaza
    Avatar
    Community Member
    182 Posts

    Youtube gallery make video embeded... Link to this post

    I downloaded the latest version from the trunk and now the template is in a .ss file (which is good) but now i have lost the ability to embed youtube movies.

    I do not want visitors leaving the website.

    Below is the old embeded part in YouTubeGallery.php

          $outputHTML = "<ul class='youtubevideos'>";
          foreach($videos as $video){   
             $duration = round((float)$video->content_duration/60, 2);      
             $video->player_url = str_replace("watch?v=","/v/",$video->player_url);
    $outputHTML .= '<object width="425" height="344"><param name="movie" value="'.$video->player_url.'"></param><param name="allowFullScreen" value="true"></param><embed src="'.$video->player_url.'" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object><div class="info"><h6>'.$video->title.'</h6><p>'.$video->description.'<br/><strong>Duration : </strong>'.$duration.'</p></div>';
          }
          $outputHTML .= "</ul>";

    The current YoutubeGallery.ss

             <div class="youtubegallery typography">
                
             <% if YoutubeVideos.Count %>
                <ul class="youtubevideos">
                <% control YoutubeVideos %>
                   <li>
                      <div class="still">
                         <% if Top.ShowVideoInPopup %>
                            <a
                               params="lightwindow_width={$PlayerWidth},lightwindow_height={$PlayerHeight},lightwindow_loading_animation=false,lightwindow_type=external"
                               href="{$PlayerURL}"
                               class="lightwindow"
                            >
                               <% control SmallThumbnail %>
                                  <img src="$URL" alt="$Title" width="$Width" height="$Height" />
                               <% end_control %>
                            </a>
                         <% else %>
                            <a href="$PlayerURL" title="$title">
                               <% control SmallThumbnail %>
                                  <img src="$URL" alt="$Title" width="$Width" height="$Height" />
                               <% end_control %>
                            </a>
                         <% end_if %>
                      </div>
                      <div class="info">
                         <h6>
                            <% if Top.ShowVideoInPopup %>
                               <a
                                  params="lightwindow_width={$PlayerWidth},lightwindow_height={$PlayerHeight},lightwindow_loading_animation=false,lightwindow_type=external"
                                  href="{$PlayerURL}"
                                  class="lightwindow"
                               >
                                  $Title
                               </a>
                            <% else %>
                               <a href="$PlayerURL" title="$Title">$Title</a>
                            <% end_if %>
                         </h6>
                         <p>
                            $Description<br />
                            <strong>Duration : </strong>$Runtime
                         </p>
                      </div>
                      <div class="clearfix"></div>
                   </li>
                <% end_control %>
                </ul>
                
                <div class="pages">
                   <div class="paginator">
                   </div>
                   <span class="results">($YoutubeVideos.Count Videos)</span>
                </div>
             <% else %>
                <span>Sorry! Gallery doesn't contain any images for this page.</span>
             <% end_if %>
             
             </div>

    Can some help me out putting the .php part into the .ss part???

    857 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.