Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > cmslistmenu webpart View modes: 
User avatar
Member
Member
lior - 8/22/2011 9:00:21 AM
   
cmslistmenu webpart
Is there anyway to change the structure of the rendered html this webpart creates, meaning adding dynamic attributes like classtype of each document without writing a manual webpart? something like a transformation for this webpart?

User avatar
Kentico Support
Kentico Support
kentico_radekm - 8/22/2011 3:03:54 PM
   
RE:cmslistmenu webpart
Hello.

Yes, you can use RenderedHTML property of this web part. This property allows you to get or set the HTML code rendered by the control. You need to set this property before the Render event - e.g. in the OnLoad event.

Best Regards,
Radek Macalik

User avatar
Member
Member
lior - 8/23/2011 3:01:29 AM
   
RE:cmslistmenu webpart
I tried it and it doesn't let me change the structure only allows me change the whole menu rendered code.
I need to be able to add a custom attribute for each menu item depending on the document type for example:
<ul>
<li docType="page">page1</li>
<li docType="article">page2</li>
<li docType="blogpost">page3</li>
</ul>

User avatar
Kentico Support
Kentico Support
kentico_radekm - 8/26/2011 6:34:51 PM
   
RE:cmslistmenu webpart
Hello.

Yes, this method returns whole menu rendered code. However, you can replace any particular sub-string of this rendered code by other sub-string (using String.Replace() method), so you can easily achieve your goal using this procedure.

Best Regards,
Radek Macalik