We're using version 4.0.3328 and ASPX templates. One section of a site we're working on features a 2-level sidebar menu which lists a few map location categories (first level) and a series of locations that belong to each (second level). The "Location" document type has a dropdown field (LocationID) which pulls its text and values from a standalone table in the database -- this is the key to this "one category to many locations" relationship.
To build the sidebar menu, we have a repeater in our ASPX page template which uses a custom query to pull the location categories from the standalone table in the database:
<h3>Regional Map</h3>
<ul>
<cms:CMSRepeater ID="cmsrptLocations" runat="server" ClassNames="custom.Location"
TransformationName="custom.Location.SidebarList">
</cms:CMSRepeater>
</ul>
The "SidebarList" transformation has a nested repeater in it which pulls in the ID of the category to list only the locations which have that category selected:
<li><%# Eval("Name") %>
<ul>
<cc1:CMSRepeater ID="cmsrptrLocations" runat="server" Path="/Locations/Sites/%"
ClassNames="custom.Location" TransformationName="custom.Location.ListItem"
WhereCondition='<%# String.Format("LocationTypeID = {0}", Eval("LocationTypeID")) %>'></cc1:CMSRepeater>
</ul>
</li>
This would seem to work fine, since the WhereCondition would end up limiting each main repeater item to displaying just the locations that belong to that category. However, with the above code we get all locations listed under each category. If I change the WhereCondition above to:
WhereCondition='LocationTypeID = 3'
Then the WhereCondition works -- but of course, we get the same set of locations under each category (the ones that have a LocationTypeID of 3).
I've tried this with a CMSRepeater and a QueryRepeater, but both have the same problem. I've also tried many different ways of setting "WhereCondition", but to no avail. It only seems to work when WhereCondition has no server-side code in it (i.e. <%# ... %> ). Bug?
Erik