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

Forums / Developing with Sitefinity / CategoriesList and DownloadList

CategoriesList and DownloadList

16 posts, 0 answered
  1. Damian
    Damian avatar
    42 posts
    Registered:
    25 Mar 2008
    13 Jun 2008
    Link to this post
    All,

    I have enabled categories in the Images & Documents module as per KB http://www.sitefinity.com/support/knowledge-base/kb-article/b1154K-hkt-b1154T-cgh.aspx.

    Which has worked well and I can now assigned categories to my documents.

    I am trying to add a categorieslist control to a page that will list the categories and link to a DownloadList control that just shows the documents for the catrgory that  was clicked on.

    When I add the categorylist Control and set providerName to Libraries the correct categories appear on the page, with the correct number of documents in brackets next to it.

    When I click on a category to go to the page with the download list on an empty download list appears.....

    Am I missing a step or property setting somewhere?

    Any help would be greatly appreciated.

    Damian
  2. Damian
    Damian avatar
    42 posts
    Registered:
    25 Mar 2008
    13 Jun 2008
    Link to this post
    Also.....

    When I set the DisplayMode for  the DownloadList to Category and click I'm done. 
    If I go back into the properties for the DownloadList the DisplayMode has reset itself to ItemList ????

    Is anyone else experiencing this problem ?  P.S I am using SiteFinity 3.2.1

    Damian
  3. Nikifor
    Nikifor avatar
    232 posts
    Registered:
    18 May 2013
    17 Jun 2008
    Link to this post
    Hello Damian,

    The DisplayMode dropdown does not work properly as it is an obsolete one. I am sorry for not clearing this out from its properties. There is another option included which can help you sort the displayed download list by categories, named SelectedCategories. In order to reach it, please follow these steps:
    1. Place the DownloadList control on a page and click Edit.
    2. Click the Advanced tab and expand the Data section.
    3. Type the name of the category in the SelectedCategories field. If you want to have several categories appearing, use "," to separate them.

    Please let us know if you need any further information.

    Regards,
    Nikifor
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  4. Damian
    Damian avatar
    42 posts
    Registered:
    25 Mar 2008
    17 Jun 2008
    Link to this post
    Hi Nikifor,

    Firstly

    The only property within the data section of the DownloadList advanced properties that I can see is ProviderName.

    As a reminder I'm using Sitefinity version 3.2 SP1.

    Secondly

    I don't think what you have suggested is a suitable solution to my problem.  I am trying to display a CategoryList for my document library that links to a downloadlist, that only shows documents from the selected category.

    This is so that categories can be added, removed, updated without me having to go into the properties everytime to update SelectedCategories as you suggested.
  5. Nikifor
    Nikifor avatar
    232 posts
    Registered:
    18 May 2013
    18 Jun 2008
    Link to this post
    Hi Damian,

    I am really sorry for the misunderstanding. I tested this behavior for the latest hot fix version 3.2 SP2 HF 1616 and the instructions in my previous email apply to it.
    The reported behavior for the DisplayMode property is indeed a problem for version 3.2 SP1, but fortunately it was fixed and the DownloadList control can filter by Categories in the latest version 3.2 SP2 HF 1616. This is why we recommend you to upgrade your project and follow the instruction from my previous post for enabling the category filtering.

    Hope this helps.

    Regards,
    Nikifor
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Damian
    Damian avatar
    42 posts
    Registered:
    25 Mar 2008
    18 Jun 2008
    Link to this post

    So does the DownloadList, DisplayMode property set to Category work in 3.2 SP2 HF 1616 or not?

    If not then your suggested solution still is not valid.
    The category to filter the DownloadList on should be taken from the querystring not from SelectedCategories.

    I need the following:

    Page 1.
    One CategoryList Control that lists all the categories from the Images & Documents module.  Like this:

    Category 1 (5)
    Category 2 (3)
    Category 3 (7)
    etc.......

    When you click on a category you are taken to page 2.

    Page 2
    One DownloadList just showing the documents in the category that was clicked on Page 1.

    I need to know if this is possible and works correctly before considering upgrading.

  7. Mike
    Mike avatar
    22 posts
    Registered:
    05 Mar 2008
    20 Jun 2008
    Link to this post
    i too enabled categories per the KB article, and that part works fine. However the DownloadList does not seem to honor nor have any option for using the categories.

    Please re-enable categories on the downloadlist control and allow it to be filtered by category per the querystring CntCatID. Heres a thought, how about keeping it consistent with EventsView, NewsView, etc.


  8. Mike
    Mike avatar
    22 posts
    Registered:
    05 Mar 2008
    20 Jun 2008
    Link to this post
    ok i started digging into the API to see if i can trick the downloadlist into filtering by the category guid. I got the idea from similar functionality i came up with yesterday to display the selected tag in the newsview.

    so far here is what i have:
    I made a new control template in the libraries for DownloadListCategorizedTableMode and added the following code.

        Protected Sub repeater_Load(ByVal sender As Object, ByVal e As System.EventArgs)  
            Dim library As New LibraryManager()  
     
            If Not Request.QueryString("CntCatID") Is Nothing Then  
                Dim catId(0) As Guid  
                  
                catId(0) = New Guid(Request.QueryString("CntCatID"))  
                    
                Me.repeater.DataSource = library.GetDocuments(0, 50, "", catId)  
            Else  
                Me.repeater.DataSource = Nothing 
            End If  
     
        End Sub 

    this doesnt work though because my downloadlist is empty when i click on one of the two categories in my categories list.

    the GetDocuments method in the librarymanager was my best hope at getting this to work.

    If anyone has any ideas as to what is wrong with the code above (aside from it being VB) please let me know.

    I REEEAAALLLY need to get the downloadlist filtering by categories.

    Thanks in advance,
    Mike
  9. Mike
    Mike avatar
    22 posts
    Registered:
    05 Mar 2008
    23 Jun 2008
    Link to this post
    i am opening a support ticket for this issue since no one seems to be responding to either damian or myself.

    Damian,
    If i receive a solution to this issue i will let you know since you started the thread.

    good luck,
    Mike
  10. Damian
    Damian avatar
    42 posts
    Registered:
    25 Mar 2008
    23 Jun 2008
    Link to this post

    Hi Mike,

    I had already raised a support ticket straight away (6/13/2008) and this thread duplicates that ticket.

    As you can see here the last response was from Nikifor was at 6/18/2008, which was posted to my ticket a day earlier.

    They are now outside their 48h response time from my latest post on the ticket.

    I'm getting concerned, because like you this is a required piece of functionality for me.

    I will continue to post anything that gets put into my ticket here, let's hope one of us hears soon.

    Damian

  11. Nikifor
    Nikifor avatar
    232 posts
    Registered:
    18 May 2013
    25 Jun 2008
    Link to this post
    Hi Damian and Mike,

    We apologize for the delay in our response, but we needed time to reach the core problem and to manage to work around it.

    Indeed there is a problem with Category List control and its resolution would involve running an SQL query. The problem occurs because in the sf_GCMetaData table where the Categories are preserved as meta fields, the CntPrntID column is somehow saved with null value. The CntPrntID column is actually used to say to the meta field which is the parent of the content. In the Images & Documents case it would save the ID of the Library which holds the image or document.

    As a workaround, I can suggest you run this script in your database:

    update  
        sf_GCMetaData 
    set CntPrntID =  
        ( 
        select distinct 
            CntPrntID  
        from  
            sf_GCMetaData as meta  
        where  
            meta.ContentID = sf_GCMetaData.ContentID 
            and meta.LangID = sf_GCMetaData.LangID 
            and meta.Application = sf_GCMetaData.Application 
            and meta.ContentID = sf_GCMetaData.ContentID 
            and meta.CntPrntID is not null 
        ) 
    where  
        CntPrntID is null 

    Please make sure you back up your database just in case.

    As mentioned by Mike, you have to
    allow the Categories List control to be filtered by category per the CategoryKey query string CntCatID. This is how the Download List control would inherit by the Categories List.

    This should fix your problem and you would be able to filter your items for Categories. If this does not solve the problem, please let us know.

    Kind regards,
    Nikifor
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  12. Damian
    Damian avatar
    42 posts
    Registered:
    25 Mar 2008
    19 Sep 2008
    Link to this post
    Nikifor, Mike,

    please can you help.

    After 3 months I am back trying to solve this problem.

    I am now using SP3.2 SP2 HF1616.

    I have enabled categories for Images & Documents and done everything as before and run your database script.

    this still isn't working !!!!!!!!!

    Please can you provide detailed (click by click) instructions no how to achieve the following:

    Enable Categories for Images and Documents

    Put a categorylist on a page (listing all the categories for a document library)

    This categorylist must link to another page that contains a download list

    The download list must display items in the document library that belong to the category that was click in the category list.


    I can't get this working and need some help

    thanks in advance

    Damian
  13. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    25 Sep 2008
    Link to this post
    Hi Damian,

    These issues are already fixed for the upcoming release of Sitefinity, so I would suggest you wait for the next version. The release is scheduled for the beginning of October

    All the best,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  14. Andy
    Andy avatar
    62 posts
    Registered:
    01 Aug 2008
    10 Dec 2008
    Link to this post

    Guys,

    With version 3.2 SP2 I am battling with the same issue, perhaps a little simpler.

    I am short on time for an upgrade to 3.5 unless I really have to, so I want to be clear that there is not an easy way to hard-wire the filter for a DownloadList to a Library Category in 3.2.

    In the DownloadList control The SelectedCategories property in the Advanced>Data categories seems to be linked to the Generic Content Categories.

    The KB article explains how to add Library Categories. (Whch I have done).

    How do I redirect the SelectedCategories property to pick from, and filter on the newly added Library Categories? (I don't need the users to pick from a category list).

    Or can this only be done in 3.5?
  15. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    16 Dec 2008
    Link to this post
    Hello Andy,

    We suggest you upgrading to 3.5 because the categories were not enabled by default in 3.2, so is the situation with the download list control.
    If you want to use 3.2 anyway, you should build custom user control which is taking the items from the libraries and check if they belong to certain category before they get rendered. You can take a look at the GetContent method for taking the Library items, and GetMetaData("Category") method for checking if the item is in the desired category.

    Sincerely yours,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  16. Andy
    Andy avatar
    62 posts
    Registered:
    01 Aug 2008
    16 Dec 2008
    Link to this post
    Thanks Georgi,

    As I had to progress on this, I've just got lots of libraries. This is a bit messy, but got the job done.

    If I get time I will look at imlementing your helpful suggestion. It's more likely that in future we will start with v3.5

    Kind regards,
    Andy
Register for webinar
16 posts, 0 answered