Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Where condition nested repeater View modes: 
User avatar
Member
Member
maggie.nu-gmail - 7/14/2011 5:54:56 AM
   
Where condition nested repeater
<cc1:CMSRepeater ID="ImagesGallery" runat="server" ClassNames="CMS.ImageGallery" TransformationName="CMS.ImageGallery.gallery_preview" StopProcessing="true" Path="/%" ></cc1:CMSRepeater>

How to add WhereCondition

i tried WhereCondition='Nodeguid=<%eval("GaleeryGuid")%>'
i keep getting error

User avatar
Member
Member
maggie.nu-gmail - 7/14/2011 6:30:33 AM
   
RE:Where condition nested repeater
WhereCondition="NodeGUID='c3225f8c-f83c-4dc1-99eb-40de6c9a17ca'"
this is working
but i need
WhereCondition="NodeGUID='<%eval("GaleeryGuid")%>'"

User avatar
Member
Member
lancetek - 7/14/2011 6:43:10 AM
   
RE:Where condition nested repeater
Hi,
You should be using a slightly different format for the macro in the where condition of the repeater:


NodeGuid='{%cmscontext.currentdocument.nodeguid%}'



Note that this does not go in the transformation itself, but in the repeater that's using it.

Tip: when looking at the 'where' condition of the repeater, if you click the little black arrow to the left of the textbox, you get a popup Gui macro-building tool where you can build a macro that'll get you the information you want, in the proper format to use. FYI - I used the macro-Gui tool to build the example above.

Tip #2: And if you look in the site manager > administration > event log, you'll see more info about your error.

Lance

User avatar
Member
Member
maggie.nu-gmail - 7/14/2011 9:13:44 AM
   
RE:Where condition nested repeater
its a nested repeater

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 7/14/2011 12:54:50 PM
   
RE:Where condition nested repeater
Hi,

could you please try to replace apostrophe with its code name?


WhereCondition="NodeGUID='<%eval("GaleeryGuid")%>'"


Best regards,
Ivana Tomanickova

User avatar
Member
Member
maggie.nu-gmail - 7/14/2011 1:04:11 PM
   
RE:Where condition nested repeater
this is the error i get

CMSDataProperties.LoadTransformation]: Server tags cannot contain <% ... %> constructs.

User avatar
Certified Developer 9
Certified Developer 9
charbf - 7/14/2011 2:23:58 PM
   
RE:Where condition nested repeater
Hi,

you can't use code inside code like this. what you can do is some thing similar to this.


<cms:CMSRepeater
ID="rptSubitem"
runat="server"
ClassNames="custom.GuidePage;custom.GuideContent"
TransformationName="custom.GuidePage.TOC"
Path="./%"
MaxRelativeLevel="1"
OrderBy="NodeOrder"
DelayedLoading="true"
SelectOnlyPublished="true" >
<HeaderTemplate><ul></HeaderTemplate>
<FooterTemplate></ul></FooterTemplate>
</cms:CMSRepeater>
<script runat="server">
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
this.repeaterAuthors.Path = (string)Eval("Author");
}
</script>