Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > nested repeater - contentBefore, container View modes: 
User avatar
Member
Member
eagleag - 6/18/2012 6:25:45 AM
   
nested repeater - contentBefore, container
Hi,

I'm using nested repeater and want to add contentBefore or choose container.

This is tired to do: (but properties not public)

<cms:CMSRepeater
ID="repeater_clients"
runat="server"
OrderBy="NodeOrder"
ClassNames="bla.BlaItem"
TransformationName="bla.BlaItem.test"
Path="./%"
TopN="10"
ContentBefore="<div id='container' class='clientSays'><div id='example'><div id='slides'>"
ContentAfter="</div></div></div></div>"
SelectOnlyPublished="true" />


So what I did insted is-> add code to transformation bla.BlaItem.test.
This is code: (it works, BUT I THINK THERE MIGHT BE BETTER WAY TO CO THIS????)

<%# DataItemIndex ==0?"<div id='container'>":"" %>
<div class="block">
<p><%# Eval("test") %>
</div>
<%# DataItemIndex==DataRowView.DataView.Count-1?"</div>":"" %>


Please advise if my solution was best way to solve the issue?

Thanks :)

User avatar
Certified Developer 9
Certified Developer 9
Petr Dvorak - 6/18/2012 4:38:37 PM
   
RE:nested repeater - contentBefore, container
Hi,

try to use elements HeaderTemplate and FooterTemplate as shown in docs -- http://devnet.kentico.com/docs/controls/index.html?cmsuniview_getting_started.htm or in this first post


User avatar
Kentico Support
Kentico Support
kentico_janh - 6/19/2012 1:45:08 AM
   
RE:nested repeater - contentBefore, container
Hello,

You can just add any HTML content before and after the nested repeater right in the main repeater's transformation:

<HTML content before>

<cms:CMSRepeater />

<HTML content after>


Best regards,
Jan Hermann

User avatar
Member
Member
eagleag - 6/19/2012 5:55:17 AM
   
RE:nested repeater - contentBefore, container
Hi,
That wont help since I want the BEFORE and AFTER content to depend on the visibility of nested repeater etv.


thasnk

User avatar
Certified Developer 9
Certified Developer 9
charbf - 6/19/2012 11:43:10 PM
   
RE:nested repeater - contentBefore, container
This is what your looking for (the red part)



<cms:CMSRepeater
ID="rptSubitem"
runat="server"
ClassNames="CMS.MenuItem"
TransformationName="CMS.MenuItem.TOC"
Path="./%"
MaxRelativeLevel="1"
OrderBy="NodeOrder"
DelayedLoading="true"
SelectOnlyPublished="true"
HideControlForZeroRows="true" >
<HeaderTemplate><ul></HeaderTemplate>
<FooterTemplate></ul></FooterTemplate>

</cms:CMSRepeater>