Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > WebParts Type Filter or DataSource (Creating expand filter) View modes: 
User avatar
Member
Member
khristoforov.v.u-gmail - 1/5/2010 1:46:21 AM
   
WebParts Type Filter or DataSource (Creating expand filter)
Hello.

It is necessary to develop the expanded filters (WebPart Type:Filter) for the user types of documents (for example, the type - the computer with set of parametres is created, it is necessary to create the filter which could filter computers on parametres (the size of a hard disk, video a card, the price, the manufacturer and others). In general we create a portal with set of various types of documents (computers, players, computer accessories, etc.) for each type will be created the expanded filters, as a result a site will offer a wide choice of the goods and convenient navigation.

In documentation Kentico it is specified that there are various types WebParts (Content, DataSource, Filter), but the mechanism of realisation of all types WebParts is not described. The linkage mechanism (processings of events WebParts on page) between WebParts, for example, WebPart Filter and WebPart Repeater, how filtered given to adhere to Repeater or to any other element of management (DataGrid, DataList) is not clear?

The logic should be very simple, the user chooses necessary parametres of type in the filter, presses the button to "filter" and a site to deduce all documents, satisfying to filter parametres.

User avatar
Kentico Developer
Kentico Developer
kentico_martind - 1/12/2010 5:00:00 AM
   
RE:WebParts Type Filter or DataSource (Creating expand filter)
Hello,

Basically you can link web parts by specifying ID of appropriate web parts into appropriate properties of other web parts. Please see Using datasource web parts article in Dev.Guide for more details.
You can inspire by code of ~\CMSModules\Ecommerce\Controls\Filters\ProductFilter.ascx(.cs) files to see how implement custom filter.

Best Regards,

Martin Dobsicek

User avatar
Member
Member
khristoforov.v.u-gmail - 1/14/2010 4:08:22 AM
   
RE:WebParts Type Filter or DataSource (Creating expand filter)
Thanks for the answer!

You can send an example of code CustomDataSourceWebPart and CustomFilterWebPart connected among themselves?

User avatar
Kentico Developer
Kentico Developer
kentico_martind - 1/20/2010 8:53:55 AM
   
RE:WebParts Type Filter or DataSource (Creating expand filter)
Hello,

Please see ~/Examples/Webparts/E-commerce/Product-filter page in sample CorporateSite for example. There is CustomFilter with datalist used but the principle is the same for CustomFilter with any other viewer. If you use ASPX templates you can check sample code in ~\CMSTemplates\CorporateSiteAspx\WebParts\Ecommerce.aspx(.cs) sample template.

Best Regards,

Martin Dobsicek

User avatar
Member
Member
khristoforov.v.u-gmail - 1/20/2010 2:16:13 PM
   
RE:WebParts Type Filter or DataSource (Creating expand filter)
Hi. Thanks for the answer.
It turns out that for each type of documents it is necessary for me to create own filter, and all fields which I wish to filter, it is necessary to describe in the logician of the filter in advance. To create the dynamic filter which would display all elements of management for a filtration of any type it is impossible?

On each type of documents it is necessary to write own DataSource WebPart, then to connect it to CustomFilter WebPart and to connect with WebPart displays of the data, for example DataRepeater. Correctly I have understood?

Problem - will write Internet shop in which to be present some types of the goods (all of them Custom: Computer, HDD, Monitor, Notebook, etc) when the user passes in certain group of the goods, he sees the filter which allows it to filter the chosen type of the goods to certain signs (at monitors it there can be following signs: the size of a diagonal, frequency, firm the manufacturer, and for laptops: the size of operative memory, weight, the sizes, the processor, etc.). Really it is necessary to create for each kind of the goods the DataSource, CustomFilter, element DataRepeater? It is possible to create the universal filter somehow?

User avatar
Kentico Developer
Kentico Developer
kentico_martind - 2/2/2010 1:57:52 AM
   
RE:WebParts Type Filter or DataSource (Creating expand filter)
Hello,

you could optionally ensure this within one filter - you could add controls for each document type (type of product) into asp:panel control and then in code-behind of filter check path of current document and display only appropriate panel and hide other panels (so if current page is supposed to display monitors you show only panel with controls for filtering monitors. Similarly in DocumentsDataSource you could set its ClassNames property in code-behind in according to current document's path (so if you are on monitors page you set data source to display only monitor documents).

Best Regards,

Martin Dobsicek