Slideshow on Homepage

rated by 0 users
This post has 51 Replies | 12 Followers

Top 10 Contributor
Posts 3,323
Points 73,040
MVPs
daveburke replied on Sat, May 26 2007 11:36 PM

Rrogahn,

It's clear using the built-in slideshow is limiting, so you might want to consider another alternative.  There's always the Flickr Slideshow control that you can drop in anywhere.  I created an Ajax CS Slideshow that seems to work pretty well on my site homepage.  I haven't decided what to do with it yet and am currently out of town.

Here's my blog post on the Ajax CS Slideshow control if that helps.

Regards,
Dave

 

  • | Post Points: 20
Not Ranked
Posts 11
Points 145
rrogahn replied on Sun, May 27 2007 1:58 AM

Thanks Dave, I'm pretty new to commnity server.  I'll give a look @ your control, is there anything special to getting images out of the galleries?  Are there OM calls for that?

  • | Post Points: 20
Top 10 Contributor
Posts 3,323
Points 73,040
MVPs
daveburke replied on Mon, May 28 2007 12:10 PM

Rrogahn,

You'll be creating a query, returning a threadset, and passing back GalleryPost data objects.  Probably the cleanest example of seeing this in action in the SDK is in class and method

\Galleries\Components\GallerySlideshowWriter.cs 

   protected virtual void WriteAlbum(Gallery g, PostCategory c) {}


Regards,
Dave

 

  • | Post Points: 20
Not Ranked
Posts 11
Points 145
rrogahn replied on Tue, May 29 2007 8:04 PM

So I was able to install all of the Ajax stuff on the server and have added the control to the page, but it's not working.  Fiddler says that it can't reach the webmethod that I specified in the SlideShowServiceMethod property.  Is there anything special that you did to get this to work?

 Thanks for all the help so far Smile

  • | Post Points: 20
Top 10 Contributor
Posts 3,323
Points 73,040
MVPs
daveburke replied on Tue, May 29 2007 11:16 PM

Rrogahn,

The Ajax Slideshow I wrote uses a Web Service I customized from the Ajax Control Toolkit.  I wrote the control for one of my clients so I haven't released it yet and don't know if I will.  Configuring CS for Ajax Toolkit support makes it a bit involved as well.  I've been blogging about the process a bit on my blog if that helps.  I haven't written about customizing the Ajax Toolkit Slideshow Control source code yet, but plan to.

Regards,
Dave



 

  • | Post Points: 20
Not Ranked
Posts 12
Points 190
robhuz replied on Mon, Sep 10 2007 4:25 PM

Don't give up on SlideShowPro yet. I figured out how to make it only display the data you want. First, use Julio Casal's method of creating a new C# class library to make a custom GallerySlideShowWriter and a custom GallerySlideShowHandler. Drop the library in your bin folder just like Julio says.

Next, in your /photos folder, copy the SlideShowPictures.ashx and re-name the copy to CustomSlideShowPictures.ashx. You need two files: one to handle default behavior for viewing albums normally and one to handle your custom behavior, for example on the home page. Only change your copy, not the original, to point to your custom slideshow handler like this:

<%@ WebHandler Language="C#" Class="CommunityServer.Galleries.Components.CustomGallerySlideshowHandler" %>

Next, you need to change your siteurls_override.config to contain this:

<?xml version="1.0" encoding="utf-8" ?>

<Overrides>

<Override xpath="/SiteUrls/locations/location[@name='common']" mode="add">

<url name="home_SlideShowPictures" path="SlideShowPictures.aspx" pattern="SlideShowPictures.aspx" vanity="photos/CustomSlideShowPictures.ashx" />

<url name="home_SlideShowPicturesScale" path="SlideShowPictures{0}x{1}.aspx" pattern="SlideShowPictures(\d+)x(\d+).aspx" vanity="photos/CustomSlideShowPictures.ashx?Width=$1&amp;Height=$2" />

</Override>

</Overrides>

See what's going on here? The home page will point to your new custom handler while the /photos folder will use the normal handler.

Now let's say I want my home page to only show a slideshow of just one gallery. In your custom GallerySideShowWriter, replace the Build() method with this:

protected override void Build()

{

StartDocument();

BuildSection(
Galleries.GetGallery(15));

 

EndDocument();

}

In this case, I only wanted to use the gallery with ID=15. By getting creative with the Build() method, you can get just about any data you want. 

Top 75 Contributor
Posts 294
Points 4,195

Hey robhuz,

    I'm a little confused as to how to get this working. I have a directory called "shows". I have a page withing that directory called pagename.aspx. I would like to have a slideshow on that page that shows the images from a specific gallery with the sectionID=2 . Instead of creating a new class library, I just added the new custom reader and handler to the CS Galleries/Components in the SDK. I'm not sure how exactly to handle the SiteUrl_Overrides and I'm not sure exactly what to add to the pagename.aspx page to drop a gallery in. Could you help me out a bit?

Thanks a lot

  • | Post Points: 20
Top 75 Contributor
Posts 294
Points 4,195

Is the ID supposed to be the sectionID or the groupID?

  • | Post Points: 5
Not Ranked
Posts 12
Points 190
robhuz replied on Fri, Oct 19 2007 9:05 AM

I'm not really a CS expert or anything, I just figured out how to solve one very specific case. You should research more about SiteUrl_Overrides. I don't know what they really mean, I just stumbled on a solution that worked. I wish CS had real documentation.

  • | Post Points: 20
Top 75 Contributor
Posts 294
Points 4,195

I have this working fine on the home page. I figured out how to get it working on the other page fine as well, but I can't filter the specific gallery I want.

  • | Post Points: 20
Not Ranked
Posts 12
Points 190
robhuz replied on Fri, Oct 19 2007 12:43 PM

What do you have in your Build method? Post it and I'll take a look. Have you compared it with the CS source code?

  • | Post Points: 20
Top 75 Contributor
Posts 294
Points 4,195

Thanks for taking the time. Here are both my custom writer and handler, 13 is the sectionID of the gallery I would like to show:

using System;
using System.Collections;
using CommunityServer.Components;
using CommunityServer.Galleries.Controls;
using CommunityServer.Galleries.Components;
using System.Collections.Generic;

namespace CommunityServer.Galleries.Components
{
    public class CustomGallerySlideshowWriter : GallerySlideshowWriter
    {
        public CustomGallerySlideshowWriter(Gallery gallery, string baseUrl)
            : base(gallery, baseUrl)
        {
        }

        public CustomGallerySlideshowWriter(Gallery gallery, string baseUrl, int categoryId, int mainImageWidth, int mainImageHeight)
            : base(gallery, baseUrl, categoryId, mainImageWidth, mainImageHeight)
        {
        }

        protected override void Build()
        {

            StartDocument();

            BuildSection(Galleries.GetGallery(13));


            EndDocument();

        }


    }
}

 

using System;
using System.Collections.Generic;
using CommunityServer.Galleries.Components;
using CommunityServer.Components;

namespace CommunityServer.Galleries.Components
{
    public class CustomGallerySlideshowHandler : GallerySlideshowHandler
    {
        public CustomGallerySlideshowHandler()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        protected override CachedFeed BuildFeed()
        {
            BaseSyndicationWriter writer = null;
            DateTime date = DateTime.Now;

            writer = new CustomGallerySlideshowWriter(CurrentGallery, this.BaseUrl, this.CategoryID, this.MainImageWidth, this.MainImageHeight);

            return new CachedFeed(date, date.ToString(), writer.GetXml());

        }
    }
}

  • | Post Points: 20
Not Ranked
Posts 12
Points 190
robhuz replied on Fri, Oct 19 2007 3:27 PM

Here are some things to try:

In my project, the custom handler is located at MyUrl.com/Photos/CustomSlideshowPictures.ashx. Find where yours is and browse it. You should get the XML for the gallery you want. If this works, then your handler and writer are fine - the problem is with our URL overrides.

 If it doesn't work, then the problem is with your writer or handler. I would suggest putting some test code in your handler to see if it even gets called. If it is, test the writer the same way. You want to make sure your custom handler is calling your custom writer.

My source code for this project is gone, so I'd have to re-create it. Sorry.

  • | Post Points: 35
Top 75 Contributor
Posts 294
Points 4,195

I browsed it, it gives me a: The resource cannot be found. I will try the other checks. Thanks for the help.

  • | Post Points: 20
Not Ranked
Posts 12
Points 190
robhuz replied on Fri, Oct 19 2007 4:11 PM

I wouldn't rule out a URL Override problem.

  • | Post Points: 20
Page 3 of 4 (52 items) < Previous 1 2 3 4 Next > | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com