ASPX templates
Version 4.x > ASPX templates > Using Repeater control in ASPX page View modes: 
User avatar
Member
Member
steve200309-hotmail - 3/5/2009 8:39:04 AM
   
Using Repeater control in ASPX page
I have two questions:

1. When using the CMS Repeater control on an ASPX page, what is the difference between, and purpose of, the "ShowForDocumentTypes" and "ClassNames" properties?

In this example from the Corporate Site:
            <uc1:repeater runat="server" ID="rptAllPosts" 
ShowForDocumentTypes="cms.blog;cms.blogpost"
ClassNames="cms.blogpost"

both properties seem to be specifying which Document Types the repeater will display. Any clarification will be appreciated.

2. As a general question, is there any documentation which explains all the properties for this control & others?

I've looked at the Kentico CMS Controls 4.0 document, which gives a couple of examples, but is not comprehensive.

I've also tried the Kentico CMS API Reference, but this doesn't help. For example, the definition of the ClassNames property is
"Property to set and get the classnames list (separated by the semicolon).


Well that much is obvious, but it doesn't actually explain what the ClassNames property is for, if you don't already know.

Any help with the above questions will be appreciated.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 3/5/2009 9:40:29 AM
   
RE:Using Repeater control in ASPX page
Hi,

ShowForDocumetTypes means for which types of documents should be the repeater displayed. E.g. you want to display it only on documents of CMS.News type in given path and not on other documents of different types in that location.

ClassNames is paramater for entering the code names of the document types which should be listed in repeater. E.g. if you are displaying News, you want to list only the documents of type News.

I hope it makes more sense now.

Best Regards,
Juraj Ondrus

User avatar
Member
Member
mrogers-brainloaf - 5/3/2009 1:21:12 PM
   
RE:Using Repeater control in ASPX page
I'd like some clarification as well. I have news items that I have given different groups of "categories". How can I select news items based on category?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 5/7/2009 10:07:33 AM
   
RE:Using Repeater control in ASPX page
Hi,

You can use the WHERE condition of the repeater where you will specify the category IDs explicitly. Or, second option is to use Category list web part together with repeater so you can easily list between the categories and documents. For more details please see this article in the Developer's guide.

Best Regards,
Juraj Ondrus

User avatar
Member
Member
mrogers-brainloaf - 5/7/2009 10:23:01 AM
   
RE:Using Repeater control in ASPX page
I'd like to use the where, but I can't find any documentation about specifying it.

<uc1:repeater runat="server" ID="rptAllPosts" ShowForDocumentTypes="cms.blog;cms.blogpost" ClassNames="cms.blogpost" WHERE="..."

doesn't seem to work or even be recognized. Where can I find documentation of the built in control aspx properties. Right now, I kind of have to guess them.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 5/7/2009 10:39:10 AM
   
RE:Using Repeater control in ASPX page
Hi,

The WhereCondition property is almost the same to the SQL WHERE condition, you only specify the condition in it, for example: WhereCondition="NodeAliasPath LIKE '/path'" or WhereCondition="DocumentID = 1"

I hope it makes more sense now.

Best Regards,
Juraj Ondrus