Easy slide show in EPiServer with LyteBox

EPiPattern: In this blog post I will introduce FileSystemDataSource and tree handy methods that you should add to your toolbox: RegisterCssFile, RegisterScriptFile and GetPageDirectory.

Now and then there is a need to make a slide show in EPiServer. I want to share that I use a very handy little script called LyteBox written by Markus F. Hay.

i18n of LyteBox

The script contains some text strings in English. I have created a tweaked version of the script derived from version 3.22 from 2007-02-07 that only uses non language specific symbols. Download the i18n version of LyteBox here.

Hiding IFrames and Flash movies during LyteBox Slide Show

There is also a function that disables any flash movies so they will not interfere with the slide show that runs on top of the page in its own layer. A colleague mentioned that this function easily can be extended to hide iframe elements if you use that for ads or similar.

Just add the following code to line 795 if you need the functionality:

Easy reference to CSS StyleSheets and JavaScript’s

There are two very handy functions available in the EPiServer TemplatePage class: RegisterCssFile and RegisterScriptFile. I always use them when I need a JavaScript or style sheet referenced form a page template or user control.

Very helpful and useful – thanks.
Any hints on how you’d go about filtering files based on their attributes (by which I mean those configured in FileSummary.config)?
From my experience so far, it doesn’t seem to be straightforward to do so.
Any further help would be greatly appreciated.

Fredrik Haglund

Hi Mark!
Basicly you will have to process the list first and then use DataSource instead of DataSourceID in the Load event.

Get the list of file by calling call ImageFileSystemDataSource.GetList() that returns a List of FileSystemItem and do a foraech loop where you filter on metadata (by adding items to a new list if they satisfy your conditions). Then assign ImageRepeater.DataSource your new list and call ImageRepeater.DataBind().