Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > CMSListMenu ID View modes: 
User avatar
Member
Member
cruz777-gmail - 12/7/2010 11:15:50 PM
   
CMSListMenu ID
Hi,

I am trying to change the ID of a ul in my menu.

I have tried all different configurations of Rendered HTML but to no avail.

public override void OnContentLoaded()
{

base.OnContentLoaded();
this.menuElem.RenderedHTML = "xxx" + this.menuElem.RenderedHTML;

this.menuElem.LoadDataAutomaticaly = false;
}

I need it to go from menuElem_UL_1 to menu4

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 12/17/2010 6:31:00 AM
   
RE:CMSListMenu ID
Hello,

Your approach with using RenderedHTML is good, however the algorithm should look rather like following one (well, in fact your can add whatever code which will work well for you). Please add following code to OnPreRender method:

this.menuElem.RenderedHTML = this.menuElem.RenderedHTML.Replace("menuElem_UL_1", "menu4"); // replace appropriate string pattern
this.menuElem.LoadDataAutomaticaly = false; //prevent to reload the menu


Please note, it is still an example and you may need to adjust it as per your needs.

Best regards
Ondrej Vasil