API Questions on Kentico API.
Version 6.x > API > Repeater with a Menu View modes: 
User avatar
Member
Member
hemanthray-gmail - 11/23/2011 12:18:21 PM
   
Repeater with a Menu
We are using a cmsrepeater for binding the menu and we get the styles what the designer has provided. But the thing which we having trouble to achieve is get the selected item class. Can i get any ideas on how could we do a transform to get a selecteditem class ?


<uc1:repeater runat="server" ID="MenueRepeaters" HideOnSubPages="True" Path="/%"
ClassNames="CMS.MenuItem" TransformationName="CMS.MenuItem.MegaMenu" OrderBy="NodeLevel, NodeOrder, NodeName" SelectTopN="7"
WhereCondition="DocumentMenuItemHideInNavigation='false'" ContentBefore="<ul id='clearfix'>" ContentAfter="</ul>"
PagingMode="querystring" PagerPosition="bottom" ResultsPosition="top" CacheMinutes="0"
EnablePaging="false" PageSize="6" SelectOnlyPublished="true" />

Thanks

User avatar
Kentico Support
Kentico Support
kentico_janh - 11/24/2011 2:46:16 AM
   
RE:Repeater with a Menu
Hello,

Of course, if you change the transformation type to Text/XML, you will be able to use macros and K# in your transformation, so you can add a selected class to some html tag like this:

{%

if (currentdocument.nodealias == NodeAlias) {
result = "class='selected'";
}

%}

Best regards,
Jan Hermann