Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Article list filter View modes: 
User avatar
Member
Member
SD-Paige - 3/27/2012 2:49:57 PM
   
Article list filter
I am trying to filter an article list by category using a url querystring but cant seem to get the right category field name for my where clause. Any ideas?

User avatar
Kentico Support
Kentico Support
kentico_janh - 3/28/2012 1:50:30 AM
   
RE:Article list filter
Hello,

You are probably looking for the following WHERE condition:

DocumentID IN (SELECT DocumentID FROM CMS_DocumentCategory WHERE CategoryID IN (SELECT CategoryID FROM CMS_Category WHERE CategoryDisplayName = N'{%category%}'))


So if you now go to the www.domain.com/page_with_that_repeater.aspx?category=internal the page displays documents, which are in internal category.

Best regards,
Jan Hermann

User avatar
Member
Member
SD-Paige - 3/28/2012 8:38:02 AM
   
RE:Article list filter
Perfect, thank you very much!

User avatar
Member
Member
SD-Paige - 3/29/2012 1:13:56 PM
   
RE:Article list filter
One last question...I want to show all of the articles if no query string value has been set (Home.aspx) and filter them when a query string value is set (Home.aspx?category=top). Can I do this in one WHERE statement?

User avatar
Kentico Support
Kentico Support
kentico_janh - 3/30/2012 2:40:29 AM
   
RE:Article list filter
Hello,

It can be probably done by one long where condition, but there is a quicker and easiest solution. You can place another repeater (or web part you use for displaying articles) on that page and you can set it to display all aricles. Now you can use context macros for a Visible porperty and you can hide second repeater, when the query string is defined or you can hide first repeater, when the query string is missing in url.

Best regards,
Jan Hermann