+1-888-365-2779
Try Now
More in this section

Forums / Designing with Sitefinity / Comments on Image Gallery

Comments on Image Gallery

10 posts, 0 answered
  1. matt Sword
    matt Sword avatar
    22 posts
    Registered:
    17 Mar 2010
    28 May 2010
    Link to this post
    Hello All,
    Has anyone implemented comments on an Image Gallery? The control is set to allow comments, but the control is not showing the comment box.
    I would like to have comments on an individual image within a Gallery if possible.


    Regards
    Matt
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    28 May 2010
    Link to this post
    Hi matt Sword,

    It could be done, but not from all modes of Image Galley Control. You can do this for list and page mode. Here are the steps that you should follow

    1. Map the external template - GalleryListViewItem.ascx - How to map a template
    2. Add reference to CommentsList control inside the template

    <dd>
     <sfWeb:CommentsList ID="commentsList" runat="server" CssClass="sf_commentsList">  </sfWeb:CommentsList>
     </dd>

    3. To enable comments for Libraries provider modify  in your web.config file.

    <cmsEngine ....>
    <add name="Libraries" allowCommnets="True"  ....

    4. Go through this post to implement backend view for comments - Comments with document library

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. matt Sword
    matt Sword avatar
    22 posts
    Registered:
    17 Mar 2010
    28 May 2010
    Link to this post
    Ivan -

    I did get the comment box control embedded on the single image page, however, I'm not sure it's actually working. I don't see any comments appearing on the page.
  4. matt Sword
    matt Sword avatar
    22 posts
    Registered:
    17 Mar 2010
    01 Jun 2010
    Link to this post
    Ivan -
    do I  need to write code to get comments associated with Image?
    On this link you have an example of doing something similar
    http://www.sitefinity.com/devnet/forums/sitefinity-3-x/developing-with-sitefinity/comments-with-document-library.aspx

    I need to write all that code to post a comment?

    Matt
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    01 Jun 2010
    Link to this post
    Hi matt Sword,

    You need to implement the code from the forum post Comments with document library ( which was included in my previous reply). Otherwise you will not be able to manage the comments from the backend.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. matt Sword
    matt Sword avatar
    22 posts
    Registered:
    17 Mar 2010
    02 Jun 2010
    Link to this post
    Ivan,
    Sorry I'm new to SF.

    Here is where I'm confused. You say "manage the comments from the back end.",but I'm not sure which back end your referring too. Do you mean DB persisting (CRUD operations) or manage and approve comments from the admin panel similar to Forum posts and comments?

    In your previous post you tell someone to create a custom module, so it appears I need to learn to create a module first. I just don't understand where the code goes and when / where all the INSERT operations are taking place after adding the comment box to template.

    Regards
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    02 Jun 2010
    Link to this post
    Hello matt Sword,

    Backend - Sitefinity administration- where you create, update, delete content items, pages users etc
    Frontend - public part of the website.

    The provided code uses base classes that persist the data through GenericContent Data provider and Nolics queries to the database.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  8. matt Sword
    matt Sword avatar
    22 posts
    Registered:
    17 Mar 2010
    02 Jun 2010
    Link to this post
    I'm able to see the comments in the Admin side, however the comment box is not persisting the comments to Database.

    my Steps:
    1. downloaded all external templates.
    2. modified GalleryListViewItem.ascx to include commentsList.ascx
    <%@ Register TagName="CommentsList" TagPrefix="sfWeb" Src="~/Custom/Templates/Templates/ControlTemplates/Generic_Content/CommentsList.ascx" %>
    ....
     
    <%@ Register TagName="CommentsList" TagPrefix="sfWeb" Src="~/Custom/Templates/Templates/ControlTemplates/Generic_Content/CommentsList.ascx" %>
    3. Added a gallery control to the SF page. Edited the Template path "SingleItemTemplatePath " to point to ~/Custom/Templates/Templates/ControlTemplates/Libraries/GalleryListViewItem.ascx

    When I load the page, I see the comments box but nothing appears to be happening.

    As you can see from my attachments I have it partially working. Do you know what else I'm missing? 
    Thanks
    Matt
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    02 Jun 2010
    Link to this post
    Hello matt Sword,

    1. Declare the control as suggested in my previous post

    <sfWeb:CommentsList ID="commentsList" runat="server" CssClass="sf_commentsList">  </sfWeb:CommentsList>

    2. Make sure that your templates looks like this one shown below

    <%@ Control Language="C#" %>
    <%@ Register Assembly="Telerik.Cms.Engine" Namespace="Telerik.Cms.Engine.WebControls" TagPrefix="sfWeb" %>
    <telerik:CssFileLink ID="CssFileLink1" FileName=""
     Media="screen" runat="server" EmbeddedFileName="Telerik.Libraries.Resources.ControlTemplates.Frontend.librariesCommonLayout.css"  />
     
    mapped
     
    <div ID="content" runat="server">
        <p class="sf_backToPhotos"><asp:HyperLink ID="backToList1" runat="server" Text="<%$Resources:Gallery_GoBack %>" /></p>
        <p>
            <asp:HyperLink ID="PreviousItem" runat="server" Text="Previous" CssClass="sf_previousItem" />
            <asp:HyperLink ID="NextItem" runat="server" Text="Next" CssClass="sf_nextItem" />
        </p>
        <p class="sf_singleImage"><asp:Image ID="Img" runat="server" /></p>
        <p ID="TitleWrap" runat="server" class="sf_singleImageCaption">
            <strong><asp:Literal ID="Title" runat="server" /></strong>
        </p>
        <ul class="sf_singleImageData">
            <li ID="AuthorWrap" runat="server">
                <asp:Literal ID="Author" runat="server" />
            </li>
            <li ID="UploadDateWrap" runat="server">
                <asp:Literal ID="UploadDate" runat="server" />
            </li>
     
            <li ID="TagWrap" runat="server">   
                <asp:Repeater ID="Tags" runat="server">
                    <HeaderTemplate>
                        <strong><asp:Literal ID="Literal1" runat="server" Text="<%$Resources:Gallery_Tags %>" /></strong>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:HyperLink ID="tagLink" runat="server" />
                    </ItemTemplate>
                </asp:Repeater>
            </li>
        </ul>
         
        <sfWeb:CommentsList ID="commentsList" runat="server" CssClass="sf_commentsList"></sfWeb:CommentsList>
    </div>

    3. Make sure that the following properties in your web.config - Libraries provider

    commentsModeration="false" allowLocalization="True"


    are set.

    4. You should set the same properties through the ControlDesigner of ImageGallery control.

    The comments are persisted by the elerik.Cms.Engine.Data.Providers.DataProvider class.

    Sample video has been attached.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  10. matt Sword
    matt Sword avatar
    22 posts
    Registered:
    17 Mar 2010
    02 Jun 2010
    Link to this post
    Ivan that's it.

    My problem was this.I have to register it like
    <%@ Register Assembly="Telerik.Cms.Engine" Namespace="Telerik.Cms.Engine.WebControls" TagPrefix="sfWeb" %>
     not like
    <%@ Register TagName="CommentsList" TagPrefix="sfWeb" Src="~/Custom/Templates/Templates/ControlTemplates/Generic_Content/CommentsList.ascx" %>
    I did declare it properly, my post was wrong.

    I really appreciate your help.
Register for webinar
10 posts, 0 answered