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

Forums / Developing with Sitefinity / Comments with document library

Comments with document library

10 posts, 0 answered
  1. Ibrahim Al-Omari
    Ibrahim Al-Omari avatar
    7 posts
    Registered:
    05 Sep 2012
    04 Aug 2009
    Link to this post
    I just implemented 3.6 sitfinity standard edtion ( trial ) , every thing wents Ok except those two small things

    First: how to enable comments on documents library ( contines .pdf , .doc etc) , i want to show an extra link in the documents list table that pops up a window with commnents for the selected document ..

    second : how to make comments allowed for registered users  so the name field got populated automatically for that logged in user ...

    Sorry if this is repeated , i tried to search the forum and could not find a simple and direct answer ..

    Ibrahim
  2. Ibrahim Al-Omari
    Ibrahim Al-Omari avatar
    7 posts
    Registered:
    05 Sep 2012
    07 Aug 2009
    Link to this post
    Any idea please , I need some hints if possible ..
  3. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    07 Aug 2009
    Link to this post
    Hi Ibrahim Al-Omari,

    Thank you for using our services.

    Unfortunately the comments functionality for the Libraries module (Images & Documents) does not come out of the box.  We have not implemented an extension for showing comments, but I think that it is achievable, though not so easy. The first thing you have to do is to edit the template for displaying the download list. You have to add an extra column to the table  (or the list) that will be a link that can will open a page. On that page you will have to drop a custom control for displaying single document items. This can be done by passing the single item GUID to that control. There you will add the comments functionality. You can find more information on how to add comments in the following forum thread. There you can also see how to modify the comments control to restrict non member users to post comments, and automatically fill the name textbox for registered users.

    Kind regards,
    Rado
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  4. Ibrahim Al-Omari
    Ibrahim Al-Omari avatar
    7 posts
    Registered:
    05 Sep 2012
    08 Aug 2009
    Link to this post

    Thank you Rado for your reply ,

    Actually I am trying to find a way to change the download  table template , I copied Sitefinity\ControlTemplates\Libraries\DownloadList.ascx from the external templates zipped file and added this entry to xml config file

        <viewSettings hostType="Telerik.Libraries.DownloadList">
          <additionalTemplates>
            <add key="ItemListTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/Libraries/DownloadList.ascx" />
          </additionalTemplates>
        </viewSettings>
       

     I altered DownloadList.ascx file to see if this will be reflected in the site with no luck ..


    Could you please assist..

  5. Ibrahim Al-Omari
    Ibrahim Al-Omari avatar
    7 posts
    Registered:
    05 Sep 2012
    08 Aug 2009
    Link to this post

    You might ignore my last post, I just started linking things together :-)

    For front end template, I changed the ItemListTemplatePath property under advanced tab to point to the external custom control : ~/Sitefinity/ControlTemplates/Libraries/DownloadList.ascx ..

    Now I am going to change the template to have a table with a link to comments pop-up page ..

    Thank you

  6. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    10 Aug 2009
    Link to this post
    Hello Ibrahim Al-Omari,

    Thank you for getting back to us.

    We are happy to see that you have found a way to implement the comments functionality. Please fell free to share to the community how your implementation goes.

    If you have more questions regarding Sitefinity, we will be more than glad to assist you.

    Regards,
    Rado
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  7. Ibrahim Al-Omari
    Ibrahim Al-Omari avatar
    7 posts
    Registered:
    05 Sep 2012
    22 Aug 2009
    Link to this post

    I just created a new page with the following comments control list

     

     

    <div id="comments" class="sf_contentComments">

     

     

    <sfWeb:CommentsList ID="commentsList" runat="server" CssClass="sf_commentsList" ParentID='<%#docid %>' >

     

     

    </sfWeb:CommentsList>

     

     

    </div>

    where docid points to the GUID for the slected document, the comments control rendered correctly, but when you try to post something it dose nothing ..

    any idea ..

     

  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    23 Aug 2009
    Link to this post
    Hello Ibrahim Al-Omari,

    Can I see the code you use to persist the data when a comment is submitted? This one of the reasons for not showing anything after submit.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  9. Ibrahim Al-Omari
    Ibrahim Al-Omari avatar
    7 posts
    Registered:
    05 Sep 2012
    24 Aug 2009
    Link to this post

    Ivan,

    could you please elaborate more, I thought once you specify the parent ID the form will recognize the target item and save the comment accordingly...

  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    24 Aug 2009
    Link to this post
    Hello Ibrahim Al-Omari,

    1. Comments works only for videos. You need to create a custom module that inherits from library module. Then create a custom command panel and enable comments for all library types.


    1.1 Create a module and override CreateControlPanel

    public class MyLibrariesModule : LibrariesModule 
        public MyLibrariesModule() 
        { 
        } 
     
        public override System.Web.UI.Control CreateControlPanel(System.Web.UI.TemplateControl parent) 
        { 
            return new CustomLibrariesControlPanel(); 
        } 
     
        
     

    1.2. Create the custom control panel:

    public class CustomLibrariesControlPanel : LibrariesControlPanel 
        public CustomLibrariesControlPanel() : base(false
        { 
        } 
     
        public override string Name 
        { 
            get 
            { 
                return "LibrariesControlPanel"
            } 
            set 
            { 
                base.Name = value; 
            } 
        } 
     
        protected override void CreateStandardCommandPanels(string viewMode, List<Telerik.Cms.Web.UI.Backend.CommandItem> commandsInfo, List<Telerik.Web.ICommandPanel> list) 
        { 
             
            if (this.ParentId != Guid.Empty) 
            { 
                CreateMyItemsCommands(list); 
            } 
            else 
            { 
                base.CreateStandardCommandPanels(viewMode, commandsInfo, list);  
            } 
        } 
     
        protected virtual void CreateMyItemsCommands(List<Telerik.Web.ICommandPanel> list) 
            { 
                 
                Telerik.Cms.Web.UI.Backend.CommandPanel helperCommandPanel = new Telerik.Cms.Web.UI.Backend.CommandPanel(); 
                helperCommandPanel.AddCommand("""LibrariesControlPanel.LibrariesView.LibraryList`1"nullnull"AllLibraries", String.Empty, "backWrapp"); 
                list.Add(helperCommandPanel); 
     
                Telerik.Cms.Web.UI.Backend.CommandPanel itemsCommandPanel = new Telerik.Cms.Web.UI.Backend.CommandPanel(); 
                itemsCommandPanel.Title = "ExploreLibrary"
                string itemsText = "Items"
                ILibrary library = this.LibManager.GetLibrary(this.ParentId); 
                if (library != null
                { 
                    switch (library.TypeName) 
                    { 
                        case LibraryInfo.Library_Image_Name: 
                            itemsText = "Images"
                            break
                        case LibraryInfo.Library_Document_Name: 
                            itemsText = "Documents"
                            break
                        case LibraryInfo.Library_Video_Name: 
                            itemsText = "Movies"
                            break
                        default
                            itemsText = "Items"
                            break
                    } 
                } 
                itemsCommandPanel.AddCommand("LibraryItemsView", ControlUtils.SliceRoute(GetControlPanelRoute(), this.Name), nullthis.ParentId.ToString(), null,  itemsText, "ItemsDescription""all"); 
                itemsCommandPanel.AddCommand("CategoriesView", ControlUtils.SliceRoute(GetControlPanelRoute(), this.Name), nullthis.ParentId.ToString(), null"Categories""CategoriesDescription""all"); 
                itemsCommandPanel.AddCommand("TagsView", ControlUtils.SliceRoute(GetControlPanelRoute(), this.Name), nullthis.ParentId.ToString(), null"Tags""TagsDescription""all"); 
     
                if (library != null && this.LibManager.Provider.AllowComments) 
                { 
                    itemsCommandPanel.AddCommand("LibraryCommentsView", ControlUtils.SliceRoute(GetControlPanelRoute(), this.Name), nullthis.ParentId.ToString(), null"Comments""CommentsDescription""all"); 
                } 
     
                if (library != null && library.TypeName == LibraryInfo.Library_Viddler_Name) 
                { 
                    itemsCommandPanel.AddCommand("ViddlerSynchronizerView", ControlUtils.SliceRoute(GetControlPanelRoute(), this.Name), nullthis.ParentId.ToString(), null"VideoSynchronizer""VideoSynchronizer_Desc""all"); 
                } 
     
                list.Add(itemsCommandPanel); 
     
                Telerik.Cms.Web.UI.Backend.CommandPanel settingsCommandPanel = new Telerik.Cms.Web.UI.Backend.CommandPanel(); 
                settingsCommandPanel.Title = "SetDetails"
                if (this.ParentId != Guid.Empty) 
                { 
                    if (this.LibManager.GetPermission(CrudRights.Modify).CheckDemand() || 
                       library.Owner.Equals(SecurityManager.GetCurrentUserName(),  
                                            StringComparison.OrdinalIgnoreCase)) 
                    { 
                        settingsCommandPanel.AddCommand("LibraryEdit`1""LibrariesControlPanel.LibrariesView"nullthis.ParentId.ToString(), "SetDetails", String.Empty, "settings"); 
                    } 
                } 
                settingsCommandPanel.AddCommand("PermissionsView", ControlUtils.SliceRoute(GetControlPanelRoute(), this.Name), nullthis.ParentId.ToString(), null"Permissions", String.Empty, "globalPerm"); 
                list.Add(settingsCommandPanel); 
            } 
     
     
     
             
             private List<string> GetControlPanelRoute() 
             { 
                 List<string> controlPanelRoute = ControlUtils.ParseRoute(ControlUtils.GetCurrentRoute()); 
                 if (controlPanelRoute.Count == 0) 
                     controlPanelRoute.Add(this.Name); 
                 return controlPanelRoute; 
             } 
     


    2. Map the external template and add CommentsList control to it.

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


    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
10 posts, 0 answered