Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Custom Filter In CMS Desk Listing Mode View View modes: 
User avatar
Member
Member
SaLiMoS - 11/28/2013 2:00:19 AM
   
Custom Filter In CMS Desk Listing Mode View
Hello,

I understand that customization to the Listing Grid in the Listing Mode View in CMS Desk can be achieved by modifying the following page: ~/CMSModules/Content/CMSDesk/View/listing.aspx.

Based on the Listing.xml, the grid columns are defined along with the filter fields, and the option to display the filter is set to True.

I would like to customize the filter dialog for certain listed document types, giving the ability to search those document types details.
For instance if I have a document type called "Employee" having fields such as First Name, Last Name, Address, email and so on.

When clicking on the page or folder containing the employees, and go into the listing mode, I would like to search not only in the document name, I would like to have field to search specifically by their name, email or other fields.

A guidance on the right approach to achieve this is much appreciated.

Thank you,
Salim

User avatar
Member
Member
kentico_johnathan - 12/9/2013 3:49:48 PM
   
RE:Custom Filter In CMS Desk Listing Mode View
It should be possible, but would require some custom coding, specifically the DocumentList control in the project folder. You can find it by going to ~\CMSModules\Content\Controls\DocumentList.ascx.cs.

You should be able to set the directory of your custom filters using the unigrid's FilterDirectoryPath property, as noted in the following documentation: devnet.kentico.com/docs/controls/unigrid_configuration.htm

Doing this, you could define a different set of filters for each document type that you wish, and switch between them on the fly when the listing is loaded.

User avatar
Member
Member
SaLiMoS - 12/9/2013 5:02:23 PM
   
RE:Custom Filter In CMS Desk Listing Mode View
Hello Johnathan,

Thank you for your reply,
Actually I was able to implement such custom filtering similarly using the steps as you described, I had to perform some custom coding in DocumentList.ascx.cs

I have created separate custom filter controls for each document type I need such filtering in, and I did create a separate XML file defining the grid columns and custom filter field for each document, and loading this XML based on the document type.

I did put an article on my Blog (still draft) regarding the steps to implement such custom filtering and will publish it and share the link as soon as I can.

I am currently looking into loading in listing mode instead of editing mode when selecting certain menu pages from the tree. I would be tankful if you can guide me where I have to implement such customization.

Thanks
Salim

User avatar
Member
Member
SaLiMoS - 12/15/2013 4:51:36 PM
   
RE:Custom Filter In CMS Desk Listing Mode View
Hi Again,

Here is the blog article describing the steps taken to achieve my desired functionality.

http://salimawad.com/2013/12/16/kentico-how-to-custom-filter-control-in-cmsdesk-listing-mode/

Salim

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 12/15/2013 8:14:37 PM
   
RE:Custom Filter In CMS Desk Listing Mode View
Are you talking about modifying it for every listing or simply doc type and custom table listings? You can simply create a filter Alternate Form with the code name "filter" and it will automatically create the filter you need. You can hide and show different fields, make them required or not, change the control type, etc. Check out the developer docs here. Click on the "automatically used alternate forms" link to see more info.

User avatar
Member
Member
SaLiMoS - 12/17/2013 4:03:29 PM
   
RE:Custom Filter In CMS Desk Listing Mode View
Hi,

Thank you for your reply,
Actually I used "filter" alternative forms before to create custom filtering for custom tables (data tab) exactly as described in the developer docs here, yet I am not sure this will work in my case (maybe I am wrong).
Basically what I wanted to achieve is creating custom filter forms in CMS Desk --> Listing Mode, when clicking on certain Page Menu Items or Folders in the tree. For example, if I have a folder in the tree named "clients" containing items of document type "cms.clients", if I click on the Folder and go into the listing mode, there will be a default filter and a UniGrid displaying the documents under this folder, the filter will be only targeting the Documents Name and Types, what I wanted is a filter based on Columns of the Clients Document Type (Name, Address, Phone, etc...).

As I described in my Blog post shared previously, I was able to achieve that with some customization.

Thanks,

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 12/18/2013 12:14:56 PM
   
RE:Custom Filter In CMS Desk Listing Mode View
The alternative form should work I'd think. You can change the control type that is used. For instance if you have a document type selector, it will allow you to choose what doc type you are viewing documents for. The alternative form controls don't have to be the same as the main form, just the same datatype and general form data. You're simply presenting the form a bit differently and possibly capturing different sets of the same type of data.