November Happy Hour will be moved to Thursday December 5th.

Alexander Haneng
Sep 27, 2010
  5935
(0 votes)

EPiImage Part 3: EPiImageGallery Property

The EPiImageGallery property gives you preview thumbnails in edit mode, drag and drop sorting and the possibility to add an image description to each image.

 

This is the third part of a four part series that started with EPiImage Part 1: EPiImageResizer

 

EPiImageGallery Property

The EPiImageGallery property is a custom property that have the following features:

  1. Thumbnail view of all the pictures in the gallery in edit mode
  2. Click the “i” button to preview the image and add an image description
  3. Drag and drop sorting

 

image

This is what the EPiImageGallery Property looks like in edit mode if no image is selected. If clicked the normal file selection dialog box is opened.

This is what the EPiImageGallery Property looks like in edit mode if it contains images. A thumbnail of each image is shown, and the images can be dragged and dropped into the right sequence. On mouse over the “i” button is shown, if clicked it opens a preview window where image description can be added.

 

If you click the “i” button you will see a bigger preview of the image and you have the possibility to add a description.

 

How do I start using it?

Simply download the module from EPiCode and install it using EPiServer Deployment Center. (It just copies in a few files, it doesn’t touch your web.config or require a rebuild)

You will now get a new property type called “EPiImageGallery”:

image

 

How do I access the property value?

You can use the EPiImagegallery Viewer user control, or you can access the collection of images directly using the GetImages(CurrentPage) method.

Here is an example:

   //Get the property
    if (!CurrentPage.Property["EPiImageGalleryProperty"].IsNull)
    {
      EPiImageGalleryProperty galleryProperty = 
CurrentPage.Property["EPiImageGalleryProperty"] as EPiImageGalleryProperty; if (galleryProperty != null) { //Get the images by calling GetImages(CurrentPage) EPiImageGalleryImageCollection imageCollection =
galleryProperty.GetImages(CurrentPage); //Databind the image collection to a repeater repGallery.DataSource = imageCollection; repGallery.DataBind(); } }

 

  <asp:Repeater ID="repGallery" runat="server">
    <HeaderTemplate><ul></HeaderTemplate>
    <ItemTemplate>
      <li>
      Image url: 
      <%# (Container.DataItem as EPiImageGalleryImage).ImageURL %><br />
      Description: 
      <%# (Container.DataItem as EPiImageGalleryImage).Description %> 
      </li>
    </ItemTemplate>
    <FooterTemplate></ul></FooterTemplate>
  </asp:Repeater>

 

Have feedback? Want to help out?

Feel free to email or twitter me with your feedback: @ahaneng :-)

And finally: Thank you to Making Waves for donating it to EpiCode!

Next and last post: EPiImageGallery Viewer.

Sep 27, 2010

Comments

Michael Horsch
Michael Horsch Mar 22, 2011 06:28 PM

What if I want to use more than 1 per page? The front end of this tool breaks because you've used 'EPiImageGallery' as the id for the div's and then the js doesn't properly handle it from there going forward.

I really like the tool but would like to use more than 1 on the same page type! :)

Please login to comment.
Latest blogs
Optimizely SaaS CMS + Coveo Search Page

Short on time but need a listing feature with filters, pagination, and sorting? Create a fully functional Coveo-powered search page driven by data...

Damian Smutek | Nov 21, 2024 | Syndicated blog

Optimizely SaaS CMS DAM Picker (Interim)

Simplify your Optimizely SaaS CMS workflow with the Interim DAM Picker Chrome extension. Seamlessly integrate your DAM system, streamlining asset...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Optimizely CMS Roadmap

Explore Optimizely CMS's latest roadmap, packed with developer-focused updates. From SaaS speed to Visual Builder enhancements, developer tooling...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Set Default Culture in Optimizely CMS 12

Take control over culture-specific operations like date and time formatting.

Tomas Hensrud Gulla | Nov 15, 2024 | Syndicated blog

I'm running Optimizely CMS on .NET 9!

It works 🎉

Tomas Hensrud Gulla | Nov 12, 2024 | Syndicated blog

Recraft's image generation with AI-Assistant for Optimizely

Recraft V3 model is outperforming all other models in the image generation space and we are happy to share: Recraft's new model is now available fo...

Luc Gosso (MVP) | Nov 8, 2024 | Syndicated blog