ASPX templates
Version 6.x > ASPX templates > Help Please CMSRepeater View modes: 
User avatar
Member
Member
brendan-ignitedcoder - 10/14/2012 9:13:27 AM
   
Help Please CMSRepeater
Can someone please verify that this is correct, I have a custom ASCX file setup:

<cms:CMSRepeater runat="server" ID="FeaturedEventsRepeater" Path="/Event-Entry/%" TopN="5">
<ItemTemplate>
<%# Eval("EventName").ToString() %>
</ItemTemplate>
</cms:CMSRepeater>

Its not displaying anything though... All I get is

Event location:
Event date and time:

Please let me know if I should do it like above or if I should do the following:

QueryDataParameters parameters = new QueryDataParameters();
GeneralConnection cn = ConnectionHelper.GetConnection();
DataSet ds = ConnectionHelper.ExecuteQuery("select top 5 * from CONTENT_Event order by EventDate", parameters, QueryTypeEnum.SQLQuery, true);
FeaturedEventsRepeater.DataSource = ds;

Been struggling with this for sometime now, did get some help on the API forum that got me this far. I also need to have a link to view the Event Details page which will also be a custom page.

Please please give me some simple sample on getting a list of document types, laying them out using the CSS provided by our designer and showing a details page.

Basically - List of events, List of news items with detail pages for each. I'm a .NET developer but I depend largely on documentation to guide me and of course nothings as eye opening as sample code.

Thanks
Brendan

User avatar
Kentico Support
Kentico Support
kentico_janh - 10/14/2012 4:50:00 PM
   
RE:Help Please CMSRepeater
Hello Brendan,

You need to specify a document type in your repeater to make it work. In you case probably following one:

ClassNames="CMS.Event"


However, I suggest you to store your transformation directly in the Site Manager -> Development ->Document types -> <given document type> -> Transformation section and then link them in your repeater like this:

TransformationName="CMS.Event.default"


And the transformation code could look like this:

<div class="my_event"><%# Eval("EventName") %></div>


Best regards,
Jan Hermann

User avatar
Member
Member
brendan-ignitedcoder - 10/15/2012 1:17:29 AM
   
RE:Help Please CMSRepeater
Jan,

Thank You very much... I've created a new Doctype to hold my transformations...

I assume I would just use Transformation="FSC.Events" as my transformation? Or do need to specify "FSC.Transformations.Events"?

Again many thanks.

Brendan

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 10/16/2012 3:07:58 AM
   
RE:Help Please CMSRepeater
Hello,

the transformation name is always: className.TrransformationName because one document type can have N transformations and N document types can have a transformation with the same name (i.e. 'default').

If I got your goal to display events (CMS.Event-s), you needn't to create a new document type for a transformation. You can simply create a transformation below an existing document type. It is practical to create transformation below the document type which it should display (the Event document type).


Best regards,
Helena Grulichova