This tutorial show how to integrate the jQuery Coverslide found here: http://dev.jqueryui.com/browser/branches/labs/powella/coverslide?rev=2701, with Umbraco.
First you need to download the zip file, you’ll need almost all the files.
Add the following files to your “scripts” folder:
Copy the folowing file to your css folder:
Add the references to your head section of your master.
Then create a usercontrol looking like this, let’s call it “coverslide.ascx”:
<asp:Repeater ID="rep" runat="server">
<HeaderTemplate>
<div class="ui-coverslide ui-coverslide-stack">
<ul id="stack">
</HeaderTemplate>
<ItemTemplate>
<li>
<img src='<%# Eval("FilePath") %>' alt='<%# Eval("Text") %>' />
</li>
</ItemTemplate>
<FooterTemplate>
</ul>
</div>
<div id="scrollbar"> </div>
</FooterTemplate>
</asp:Repeater>
The codebehind should look identical to to the codebehind file described earlier in “MediaFolderContent”:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using umbraco.presentation.nodeFactory;
using umbraco.cms.businesslogic.media;
namespace HeltBlank.UmbracoModules
{
public partial class MediaFolderContent : System.Web.UI.UserControl
{
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
Media med = new Media(MediaFolderID);
var lst = from p in med.Children
where p.getProperty("umbracoFile") != null
orderby p.Text
select new { Text = p.Text, FilePath = p.getProperty("umbracoFile").Value };
rep.DataSource = lst;
rep.DataBind();
}
public int MediaFolderID { get; set; } //type: mediaCurrent
}
}
Then in umbraco do the following:
Sources: http://dev.jqueryui.com/browser/branches/labs/powella/coverslide?rev=2701