Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Edit Breadcrumbs Default Code View modes: 
User avatar
Member
Member
kelements - 2/24/2011 7:38:18 PM
   
Edit Breadcrumbs Default Code
The breadcrumb code for my site is this by default:
<div class="BreadBox"><a href="/KenticoCMS/Food.aspx" class="CMSBreadCrumbsLink">Food</a> > <span class="CMSBreadCrumbsCurrentItem">Cheeseburgers</span>

I need to edit the above code so I can wrap div tags around the href and span tags,

<div class="BreadBox"><div class="breadcrumblink"><a href="/KenticoCMS/Food.aspx" class="CMSBreadCrumbsLink">Food</a></div> > <div class="breadcrumbcurrent"><span class="CMSBreadCrumbsCurrentItem">Cheeseburger</span></div>

Where do I edit this default breadcrumb setting?

Thanks!!


User avatar
Member
Member
kentico_michal - 3/2/2011 8:51:01 AM
   
RE:Edit Breadcrumbs Default Code
Hi,

Regrettably, this could be done only by editing the RenderedHTML property which gets/sets the rendered HTML code in code-behind (either breadcrumbs webpart or ASPX template where is it used).

You can get the rendered HTML, parse it, change it and add new div tags with classes according to your needs.

this.<name of the control>.LoadDataAutomaticaly = false;
string s = this.<name of the control>.RenderedHTML;
// here please change the HTML code
this.<name of the control>.RenderedHTML = s;


In case of BreadCrumbs web part, this should be done in OnPreRender method.


Best regards,
Michal Legen