ASPX templates
Version 5.x > ASPX templates > style breadcrumb in <ul> <li> View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
adam-syndicut - 9/30/2010 11:28:47 AM
   
style breadcrumb in <ul> <li>
i've registered the breadcrumb control on my aspx page
<%@ Register Src="~/CMSWebParts/Navigation/cmsbreadcrumbs.ascx" TagName="BreadCrumb" TagPrefix="uc1" %>

when i view the page it works fine but only displays <a> and <span>

i'm going to hardcode the home link in, unless there is a way of doing this with the control

what i want to do is wrap the breadcrumb in and list

so

<ul>
<li><a href="/">Home</a></li>
<li><span>category 1</span></li>
</ul>

how and where do i implement this?


User avatar
Member
Member
eric.rovtar-hudsonchapel - 9/30/2010 5:21:22 PM
   
RE:style breadcrumb in <ul> <li>
I don't think you can actually do this. I took a quick look at the Breadcrumbs webpart and it inherits the CMSBreadcrumbs object which isn't editable but this might be it: CMSAdminControls/UI/PageElements. Note: If you edit this file and then it gets replaced in an update/hotfix, you'll loose your work.

Here are some quick steps of how to edit a Web Part in the future, though:

First, you're going to want to clone the WebPart. What this does, is create a copy of the WebPart, this way, when you apply a Hotfix, you won't accidentally overwrite your work.

Do do this, go to SiteManager > Development and select WebParts. Scroll down the list, expand Navigation, and select Breadcrumbs. Click "Clone Web Part" above that. In the popup window, give it a new name, new codename, and new filename. Click "Ok."

Now, in Visual Studio, open your Web Solution. You'll find the cloned control in the CMSWebParts/Navigation/ folder. Select the filename you created above, and open the control.

From there, you can edit the code to do what you want it to do.

Finally, use your new Breadcrumbs control instead of the standard one.

I hope this helps!

-Eric

User avatar
Certified Developer v7
Certified  Developer v7
adam-syndicut - 10/1/2010 5:13:38 AM
   
RE:style breadcrumb in <ul> <li>
what about using the renderedHtml Property?

seen a couple of posts about using it with other controls but not the breadcrumb and don't see much documentation on this. actually no documentation!

i tried this

protected void BreadCrumb_Load(object sender, EventArgs e)
{
BreadCrumb.RenderedHTML = "<li>" + BreadCrumb.RenderedHTML + "</li>";
BreadCrumb.LoadDataAutomaticaly = false;
}

this outputs

<li><a href="link.aspx">link</a> - <span>current page</span></li>


User avatar
Certified Developer v7
Certified  Developer v7
adam-syndicut - 10/1/2010 5:46:38 AM
   
RE:style breadcrumb in <ul> <li>
managed to hack it together usiing


<%@ Register Src="~/CMSWebParts/Navigation/cmsbreadcrumbs.ascx" TagName="BreadCrumb" TagPrefix="uc1" %>
<ul>
<li><a href="/">Home</a></li>
<li><span>></span></li>
<li>
<uc1:BreadCrumb ID="BreadCrumb" runat="server" SelectOnlyPublished="true" BreadcrumbSeparator="</li><li><span>></span></li><li>" />
</li>
</ul>


works but obviously not pretty.