Album name in template - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Album name in template

  • Album name in template
  • Does anyone know how to add (if its possible) the album name to a image gallery template?  I tried the following, but got an error parsing template:

    <%@ Control Language="C#" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.ContentUI" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.PublicControls.BrowseAndEdit" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <sf:ResourceLinks id="resourcesLinks" runat="server">
      <sf:ResourceFile JavaScriptLibrary="JQuery"/>
      <sf:ResourceFile JavaScriptLibrary="JQueryFancyBox"/>
    </sf:ResourceLinks>
    <sf:ResourceLinks id="resourcesLinks2" runat="server" UseEmbeddedThemes="true" Theme="Default">
      <sf:ResourceFile Name="Telerik.Sitefinity.Resources.Themes.Basic.Styles.fancybox.css" Static="true" />
    </sf:ResourceLinks>
    <sf:BrowseAndEditToolbar ID="browseAndEditToolbar" runat="server" Mode="Edit"></sf:BrowseAndEditToolbar>
    <telerik:RadListView ID="ItemsList" ItemPlaceholderID="ItemsContainer" runat="server" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false">
      <LayoutTemplate>
    <sitefinity:TextField runat="server" DisplayMode="Read" Value='<%# Eval("Album")%>' />
        <ul class="sfimagesTmbList sfLightboxMode">
          <asp:PlaceHolder ID="ItemsContainer" runat="server"/>
        </ul>
      </LayoutTemplate>
      <ItemTemplate>
        <li class="sfimagesTmb">
          <sf:SitefinityHyperLink
              CssClass="sfLightBox"
              runat="server"
              rel="mainImageGallery"
              id="singleItemLink"/>
    <sitefinity:TextField runat="server" DisplayMode="Read" Value='<%# Eval("Title")%>' CssClass="imagetitle"/>
        </li>
      </ItemTemplate>
    </telerik:RadListView>
    <sf:Pager id="pager" runat="server"></sf:Pager>
  • Hi Amanda,

    Using a tag:
    <sitefinity:TextField runat="server" DisplayMode="Read" Value='<%# Eval("Album")%>' />
    will always result in an error parsing the template. you can add the tag to the list items, but this will show the album name over each image. As the layout template will not allow you to use the text field you may only enter static text here:
    <LayoutTemplate>
        <ul class="sfimagesTmbList sfLightboxMode">
    <div>
    <p> Album Name</p>
    </div>
          <asp:PlaceHolder ID="ItemsContainer" runat="server"/>
        </ul>
      </LayoutTemplate>
    and style the div appropriately with css.
    There is one more option. Create a custom field for images and fill it with default value which can be displayed over each image.
    <ItemTemplate>
     
        <li class="sfimagesTmb">
    <sitefinity:TextField runat="server" DisplayMode="Read" Value='<%# Eval("AlbumName")%>' />
          <sf:SitefinityHyperLink
              CssClass="sfLightBox"
              runat="server"
              rel="mainImageGallery"
              id="singleItemLink"/>
        </li>
      </ItemTemplate>
    I realize this is not a valid solution when you have multiple albums and many image galleries on various pages.

    Kind regards,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items