R2i DotNetNuke Blog

 

How-to: Create an Apple-styled Breadcrumb in DotNetNuke

Friday, June 11, 2010 by Cuong Dang

In today's web design world, many people spend a lot of time perfecting little things on their website. It shows how detail oriented you are; whether working on your own project or well a client's. One of the design elements that does not often get much attention in the DotNetNuke world is the site’s breadcrumb.

It's not that people don't design beautiful little elements to enhance their site, but it is generally perceived that the core skin object provides for limited customization without modifying the core. Well, in this article, I'm going to show you how to be creative in working with that we have without modifying the core to implement an iconic breadcrumb design.

I'm using the breadcrumb from http://apple.com website, which has visually appealing, yet subtle elements that is actually a very user friendly way to visualize the site’s navigation trail.

Outside of Apple’s implementation, the breadcrumb is often a very useful element for content heavy site and in the e-commerce world. I’ve provided the demo and the source below. Keep reading to find out more about the details of the implementation.

View Demo  Download the Source

Before We Start:

This article assumes that you know the basics of DotNetNuke skinning. I will walk through a bit of core DotNetNuke breadcrumb configuration as well as some styling that help accomplishing the design. The purpose of this article is to show you that it is possible to achieve cool design without modifying the DotNetNuke core or creating your own skin object.

Step 1: Adding the Breadcrumb Skin Object

Register the breadcrumb control at the top of the skin file:
Breadcrumb registration code

Place the breadcrumb element in the desired location. It renders the basic breadcrumb path for the site.
Breadcrumb code

Step 2: Breadcrumb Level Explained

There are 3 options to configure the breadcrumb behavior.

  • 0: Show the entire path of the site breadcrumb and current page you're on
  • -1: Show the entire path of the site breadcrumb including 'Root' item which allows users to return to the root of the DotNetNuke instance. If you have multiple portals on your DNN instance and want to limit users just to be able to access the homepage of that portal, this is not an option to use.
  • n: where n is an integer greater than 0, it will skip n breadcrumb tabs before displaying the links

In this example, I'm going to use '0' to show pages with a full path excluding the 'Root' item.

Breadcrumb code with Level defined

Since we select the option to display links at level 0, we need to create a way for people to return to home page. I'm going to create a simple HTML static link and give it a CSS selector for ease of styling.

Breadcrumb code

Step 3: Adding Seperator

You can add a simple pipe (|) or a greater than (>) symbol to the breadcrumb as follow:

Breadcrumb code with separator

Or you can add HTML and CSS selector to allow creativity:

Breadcrumb code with separator

The above markup may look complicated, but it is really just Separator="<span></span>"  written safely in XML encoding format so DNN will render it properly. I added the HTML span tag so we can target it using CSS to display a background image for the separator instead of an HTML character.

Step 4: Sprinkle in Some Style

Now that we have the breadcrumb in place, we need to create the CSS to accomplish our design. But first, let's take a look at the HTML output so we have a better understanding of which elements we should style with CSS.

breadcrumb HTML output by DNN

Let's wrap this breadcrumb in a DIV so I can add a background image:

the full HTML

Now for the CSS

Set the background for the entire breadcrumb and some additional styling:

site breabcrumb css code

Reset the SPAN element to behave as block element instead of inline:

site breabcrumb span css code

Set the background for the separator and some additional styling to properly position it between links:

site breabcrumb span CSS reset

We want to add a little padding/spacing between links. But since they are inline elements, we need to turn them into block elements:

site breabcrumb link

Set the background for the return to homepage link to an icon:

site breabcrumb home page link

Step 5: Putting it All Together

HTML:

html for apple styled breadcrumb

CSS:

Full css needed for the breadcrumb

Here you go! Hope this article helps to give a better understanding of going out of the box for the breadcrumb design in DNN web site. Feel free to let me know if you have any questions. Enjoy!

View Demo  Download the Source

 
Comments

2500 characters remaining

Add Comment
Recent Comments

August 09, 2011

Jewelry And Accessories
Expensive valuable <a href="http://www.gets.cn/wholesale-Freshwater-Pearl-Pendant-174.html">freshwater pearl</a> diamond jewelry can often be as well pricey for females that prefer to accessorize their entire outfits. several females have so turned to costume jewelry, which is generally a less expensive and equally as stylish option. The extra room inside their pocketbooks opens the door for them to own a range of diamond jewelry and accessories, which include necklaces, handbags, scarves, earrings, bangles and bracelets instead than somebody expensive piece.
Caring For Costume Jewelry
Although costume diamond jewelry is simply as stylish it could perhaps be often made from inexpensive material that might not tolerate tough use. Therefore, as a means to keep you're stylish inexpensive accessories somebody should definitely apply extra attention to keep its quality. meticulous right here really are a few necessary attention ideas to lengthen the lifestyle of the costume jewels.
* often keep costume diamond jewelry in a soft linen bag.
* thoroughly clean the diamond <a href="http://www.gets.cn">wholesale beads</a> jewelry at ordinary intervals. You can thoroughly clean items, which include a layered necklace by using a soft baby toothbrush.
* Use a soft cotton swab to wipe aside the dirt and grime. there's no need to have to rub it, simply

5 May 13, 2011

">90% of the browser market is IE"? What are you smoking man? Try ~%23. Don't waste your time with ie and make the world a better place.

5 April 08, 2011

Nice show with good instruction.
<a href="http://www.abc.com">abc</a>

August 27, 2010

If >90% of the browser market is IE, and this won't work in IE, what's the point of this exercise Dang??!!

C'mon, make it work in IE !!!!

4 August 23, 2010

c?m on nhi?u

5 June 29, 2010

Brilliant. Thanks for showing me how to

June 14, 2010

Sorry mate, I realized it doesn't play nice with older versions of IE, but we don't really support it unless clients ask for it :-)

4 June 14, 2010

Awesome!

It doesn't, however, look so hot in IE 6 and 7 (and 8 in comp mode) - but that's just a matter of CSS...

June 12, 2010

Cool!

June 11, 2010

Love it, we need more of those tutorials in DNN community

Cuong Dang June 11, 2010

Thanks for the heads up, I got the wrong screenshots. It's fixed now.

4 June 11, 2010

You have examples of .aspx in your code, but you print it out as ".apsx" Just FYI. I'm going to try and implement this after I clean up the code.

Thanks for this awesome tutorial!!! We need more things like this.

5 June 11, 2010

estupendo, así se hace!

4 June 10, 2010

Thats awesome, but it breaks in IE8 compatibility mode...
which I assume means it breaks in IE7.
Got a fix for that?

5 June 10, 2010

Thanks guys! I may release a couple skin objects as well in the next couple days!

5 June 10, 2010

Cuong Dang June 10, 2010

Glad you guys find it useful!

5 June 10, 2010

Thanks for shareing this, this is awesome...

4 June 10, 2010

Outstanding example of making DNN look fantastic! Thanks. :)

June 10, 2010

Looks slick! Thanks for posting. I look forward to spicing up one of my sites with this.
 

Most Discussed

 

Subscribe to our blog

 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seatle, WA • 410.327.0007 • info@R2Integrated.com

Bookmark & Share Bookmark and Share