ASPX templates
Version 5.x > ASPX templates > Nested Repeater Showing All Docs Under Current Path View modes: 
User avatar
Member
Member
gstaylor-sfopera - 10/8/2010 3:49:27 PM
   
Nested Repeater Showing All Docs Under Current Path
I'm trying to create a nested repeater display that will show the following;

Job type1 (cms.folder)
--Job1 Preview (doc type) (doctype="custom.sfojob")
--Job2 Preview (doc type)

Job Type2 (cms.folder)
--Job3 Preview (doc type)

But what I'm getting is this;

Job Type1 (cms.folder)
--Job1 Preview (doc type)
--Job2 Preview (doc type)
--Job3 Preview (doc type)

Job Type2 (cms.folder)
--Job1 Preview (doc type)
--Job2 Preview (doc type)
--Job3 Preview (doc type)

I've set a cmsrepeater at the template level as follows;
<uc1:cmsrepeater runat="server" ID="jobsRepeater" ClassNames="CMS.Folder"
TransformationName="CMS.MenuItem.sfojobtype" NestedControlsID="sfoJobsDataList" Path="/About/Employment---Volunteering/Career-Opportunities/%/" />

and in the transformation I have the following;

<%@ Register Src="~/CMSWebParts/Viewers/Documents/cmsdatalist.ascx" TagName="cmsdatalist" TagPrefix="uc1" %>
<p style="font-size:16px;font-weight:bold;"><%# Eval("DocumentName") %></p>
<p>
<uc1:cmsdatalist ID="sfoJobsDataList" runat="server" ClassNames="custom.sfojob" TransformationName="custom.sfojob.Preview" SelectedItemTransformationName="custom.sfojob.Default" RepeatDirection="Vertical" RepeatLayout="Table" RepeatColumns="1" />
</p>

-------

So what am I doing wrong?

User avatar
Member
Member
gstaylor-sfopera - 10/9/2010 12:53:42 AM
   
RE:Nested Repeater Showing All Docs Under Current Path
I should also note that the job listing doc types are children of "folder" doc types under the job listings template.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 10/11/2010 3:56:29 AM
   
RE:Nested Repeater Showing All Docs Under Current Path
Hi,

Could you please try to remove following code from your transformation?
<%@ Register Src="~/CMSWebParts/Viewers/Documents/cmsdatalist.ascx" TagName="cmsdatalist" TagPrefix="uc1" %> and change uc1 to cc1.

The result should look like this one:


<p style="font-size:16px;font-weight:bold;"><%# Eval("DocumentName") %></p>
<p>
<cc1:cmsdatalist ID="sfoJobsDataList" runat="server" ClassNames="custom.sfojob" TransformationName="custom.sfojob.Preview" SelectedItemTransformationName="custom.sfojob.Default" RepeatDirection="Vertical" RepeatLayout="Table" RepeatColumns="1" />
</p>

This way you should achieve your goal.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
gstaylor-sfopera - 10/11/2010 10:58:35 AM
   
RE:Nested Repeater Showing All Docs Under Current Path
That worked! Thanks!

Should I only reference the controls (vs. webparts) in .aspx templates and transformations? We're not using the portal engine, just .aspx templates.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 10/12/2010 3:30:00 AM
   
RE:Nested Repeater Showing All Docs Under Current Path
Hi,

You can use both - controls and weparts on your aspx templates.
In transformation you should prefer to use controls. Web parts are not tested here.
In case of nested settings it is recommended to use controls.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
gstaylor-sfopera - 10/15/2010 9:59:33 PM
   
RE:Nested Repeater Showing All Docs Under Current Path
New problem...

When a job listing is selected, it shows once for each section. So, if I have two folders defined, the job listing in the default transformation will show twice. If I have three folders, it will show three times and so on.


User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 10/18/2010 6:46:16 AM
   
RE:Nested Repeater Showing All Docs Under Current Path
Hi,

Could you please describe this issue with more details and provide some example? Some screenshot may be useful.

What is the requested result?

Best regards,
Ivana Tomanickova



User avatar
Member
Member
gstaylor-sfopera - 10/18/2010 11:54:22 AM
   
RE:Nested Repeater Showing All Docs Under Current Path
The problem, as I explained, is that if I had two folders under the parent and one job listing under only one of them, the one job listing would show up twice in the default transformation; once for each folder name listed. If I had three folders, it would show three times and so on.

I was able to solve the problem, thanks, but I'm not sure exactly how. In doing so, I seem to have come across two different ways to set the "Path" property of the CMSRepeater control.

I've got two different templates each using a nested repeater set up.

The first is for press releases and it uses the same template for it's children. I've set the path for the parent repeater of "/{0}/{1}/{2}/" and the class name for "CMS.MenuItem". This works for us by not showing every press release for every child under it (I was having the exact same problem as I did for the job listings).

Our second is for job listings which does not use the same template for it's children but uses the "folder" doc type instead (because our internal client did not want the sub sections to show in the menu list). The parent repeater on that listing page needed to show the folder names as sections (or psuedo "categories") but the parent repeater path on that page is set as "/{0}/{1}/{2}/{3}/%".

It took MUCH going back and forth to figure out the right path setting for each of these situations in order to get the child types to show up the way we needed.

What I don't understand is how paths are supposed to be applied under a given situation (folders as child types vs. menu items as child types). I had no way of knowing what path to apply so that dupes would not show up in either the parent or the repeater.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 10/25/2010 5:50:01 AM
   
RE:Nested Repeater Showing All Docs Under Current Path
Hi,

In case of following content structure (all documents based on one template):

Parent (with repeater webpart)
-Folder1
--Article1
--Article2
-Folder2
--Article3

Settings of the repeater webpart:
Path: empty
Transformation: CMS.Folder.list
Document types: CMS.Folder
Nested controls ID: sfoJobsDataList

CMS.Folder.list tranformation:

<%@ Register Src="~/CMSWebParts/Viewers/Documents/cmsdatalist.ascx" TagName="cmsdatalist" TagPrefix="uc1" %>
<%# Eval("DocumentName") %>

<p style="font-size:16px;font-weight:bold;"><%# Eval("DocumentName") %></p>
<p>
<cc1:cmsdatalist ID="sfoJobsDataList" runat="server" ClassNames="cms.article" TransformationName="cms.article.default" SelectedItemTransformationName="cms.article.Detail" RepeatDirection="Vertical" RepeatLayout="Table" RepeatColumns="1" />
</p>


Using this settings and the transformation:
1. If you click on the Parent document you will see following content:

-Folder1
--Article1
--Article2
-Folder2
--Article3

2. If you click on the Folder1 document you will see following content:
-Folder1
--Article1
--Article2

Could you please show us your point on the similar example? It helps us to understand the issue.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
gstaylor-sfopera - 10/28/2010 10:14:46 PM
   
RE:Nested Repeater Showing All Docs Under Current Path
Thank you, Ivana. I was able to solve the problem.

I have a similar set of code where a parent repeater is using a class name of "CMS.MenuItem" (vs. Folder) and I'm having a different issue with regard to how child documents are being displayed.

However, I will start a new thread on that issue to avoid any confusion.