This project is read-only.

How to select specific album.

Jun 30, 2009 at 10:05 PM

Hello,

I have more than 1 album on my data.xml.

I did a form to insert new album to that data.xml. Now, i want to show that album in another page.

I wonder if I can choose the album to be loaded first.

My intention is view/select album by QueryString with cod or title, or html generated file.

Intellisense didn't show the correct information about each method, so i am a confused.

Can i call any method here to choice the specific album?

<script type="text/javascript">
          new SlideShow.Control(new SlideShow.XmlConfigProvider({url:"slideshow/Configuration.xml"}));
</script>

Or have any other easy solution?

Thank you and congratulations for this project. Is really really nice and helpful !


Jul 1, 2009 at 8:49 AM

Hi,

to select a album  by QueryString you can change Navigation.cs:

 public static void StartSlideShow()
{
            //OlafB begin
            string query = System.Windows.Browser.HtmlPage.Document.DocumentUri.Query;
            if ( query != null && query.StartsWith("?album="))
            {
                query = query.Substring(7);
                if (query.IndexOf("&") > 0)
                {
                    query = query.Substring(0, query.IndexOf("&"));
                }
                int i;
                //Page.Alert(query);
                //album by index?
                if (int.TryParse(query, out i))
                {
                    SelectAlbum(i);
                    return;
                }
                //album by title?
                for (int a = 0; a < DataHandler.Albums.Length; a++)
                {
                    if (DataHandler.Albums[a].Title == query)
                    {
                        SelectAlbum(a);
                        return;
                    }
                }
            }
            //OlafB end
            SelectAlbum(DataHandler.CurrentAlbumIndex);
}

Then you can call your page with

www.sample.com/slideshow.html?album=7

or

www.sample.com/slideshow.html?album=MyAlbumTitle

Olaf

 

Jul 2, 2009 at 1:57 AM

Hey olaf,

Thanks for your reply.

I was checking my project and my slideshow directory but i don't have a Navigation.CS

Should i insert it on my project?

I am sorry for my mistake, i am a not a advanced programmer...

Thank you again.

Jul 8, 2009 at 8:41 PM

I entered the select album by title as a new issue, and hope to add it soon.

http://slideshow2.codeplex.com/WorkItem/View.aspx?WorkItemId=3476

Jul 9, 2009 at 1:03 PM

Nice sbeeler.

I really want to keep this Slide Show tool on my website.

I will love if you post something when you add it.

Also, i am following that work item post.

Thanks very much again.

Jul 12, 2009 at 11:59 PM

Addressed in change set 25960.  You can now specify the start album by either the album index or the album name via the query string.  Note that with this code change the album query string parameter does NOT need to be the first item in the querystring (as would be required by the code presented above).

So, you can now start you slide show in a specific album using either of the following:

www.sample.com/slideshow.html?album=7

or

www.sample.com/slideshow.html?album=MyAlbumTitle

See http://slideshow2.codeplex.com/SourceControl/changeset/view/25960 for code changes to Navigation.cs

Jul 13, 2009 at 5:32 AM

Haha, NICE !

I will do my tests tomorrow and i will post another reply here with my final conclusions.

Thank youuuuuuuuu.

Jul 13, 2009 at 6:08 AM

As of change set 25970 you can now also specify the initial album and slide index via the initParams (or via the query string).

For Example:
<param name="initParams" value="ConfigurationProvider=XmlConfigurationProvider;Path=../XMLConfiguration/Configuration.xml,DataProvider=XmlDataProvider;Path=../XMLConfiguration/Data.xml;Album=2;SlideIndex=4" />

See http://slideshow2.codeplex.com/SourceControl/changeset/view/25970

Note that querystring takes precedence over initParams.