• home
  • forum
  • my
  • kt
  • download
  • Monoslideshow and EE Gallery

    Author: 2008-08-28 10:49:57 From:

    In your gallery template group create a new RSS/XML template called mono_xml. To this template we are going to add our XML but we have to dynamically generate it from our EE gallery. you can download my template from here

    To explain the XML

    1. {assign_variable:gallery_url="http://www.somesite.com/images/photos/"}
    2. {assign_variable:gallery_name="myphotos"}
    3. {assign_variable:gallery_number="1"}
    4. <?xml version="1.0" encoding="UTF-8"?>
    5. <slideshow>
    6. <preferences />

    Change variables above to suit your own gallery. The preferences tag will be where we add our generated preferences from the Monoslideshow demo page.

    1. {exp:query sql="SELECT cat_id,cat_folder FROM exp_gallery_categories WHERE gallery_id = '{gallery_number}'"}
    2. &#123;exp:gallery:entries gallery="{gallery_name&#125;" category="{cat_id}" limit="500"}
    3. <album thumbnail="{gallery_url}{cat_folder}/{category}_thumb.jpg" title="{category}" description="{category_description}" imagePath="{gallery_url}{cat_folder}/" thumbnailPath="{gallery_url}{cat_folder}/">

    Do you see the parameter for thumbnail in the album tag above? This is how we get our album images. Pick a suitable category image that you wish to have for an album image and replace the actual image name with the name of the category group it resides in.

    Album Thumbnails

    1.  
    2.  {entries}
    3. <img src="{filename}.jpg" title="{title}" description="{caption}"/>
    4. {/entries}
    5. </album>
    6. &#123;/exp:gallery:entries&#125;
    7. &#123;/exp:query&#125;
    8. </slideshow>

    Slideshow Preferences

    Head over to the Monoslideshow demo page and make all your changes to the preferences refreshing the slide show there as you go. When you are happy with how it looks click on the download XML button. This will let you save an XML file to your computer. Open this file and do you remember I mentioned the preferences tag above. Copy and paste the generated preferences into your mono_xml template where I pointed out above. All you need are the preference

    SWFObject

    SWFObject if you haven't come across it before is a Javascript Flash Player detection and embed script.

    SWFObject is a small Javascript file used for embedding Macromedia Flash content. The script can detect the Flash plug-in in all major web browsers (on Mac and PC) and is designed to make embedding Flash movies as easy as possible. It is also very search engine friendly, degrades gracefully, can be used in valid HTML and XHTML 1.0 documents, and is forward compatible, so it should work for years to come.*

    Download SWFObject 1.5 For the purposes of this tutorial I won't be covering the detection variables but the site has a load of info on how to do this. We will only be using one file from the download (swfobject.js) Upload this JavaScript to wherever you keep your scripts on your server e.g. http://www.somesite.com/scripts/swfobject.js

    The Slideshow Template

    Open Up the template where you want the slideshow to appear. In the header of the template we are going to link to our SWFObject we just uploaded

    1. <script type="text/javascript" src="http://www.somesite.com/scripts/swfobject.js"></script>

    To use SWFObject we have to add a div to the template with an id of 'mssHolder'.
    This is where our Slideshow will appear

    1. <div id="mssHolder">
    2. <p>Temporary holder for the Flash object</p>
    3. </div>

    We then add the javascript to display it. Change the paths and size to reflect yours

    1. <script type="text/javascript">
    2. var so = new SWFObject("http://www.yoursite.com/images/monoslideshow.swf", "mss", 480, 360, "7", "#ffffff");
    3. so.addVariable("showLogo", "false");
    4. so.addVariable("dataFile", "http://www.yoursite.com/index.php/gallery/mono_xml/");
    5. so.write("mssHolder");
    6. </script>

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      Ad Management (4)
      Calendars (3)
      Chat Systems (7)
      Content Management (19)
      Cookies and Sessions (11)
      Counters (15)
      Database Related (20)
      Date and Time (13)
      Development (19)
      Discussion Boards (8)
      E Commerce (8)
      Email Systems (13)
      Error Handling (7)
      File Manipulation (24)
      Flash and PHP (6)
      Form Processing (19)
      Guestbooks (12)
      Image Manipulation (21)
      Installing PHP (7)
      Introduction to PHP (23)
      Link Indexing (8)
      Mailing List Management (9)
      Miscellaneous (53)
      Networking (8)
      News Publishing (9)
      OOP (24)
      PEAR (6)
      PHP vs Other Languages (2)
      Polls and Voting (6)
      Postcards (1)
      Randomizing (14)
      Redirection (11)
      Searching (9)
      Security (29)
      Site Navigation (16)
      User Authentication (14)
      WAP and WML (7)
      Web Fetching (8)
      Web Traffic Analysis (15)
      XML and PHP (16)

    New

    Hot