Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Breadcrumb links with style

Hi,

I'm trying to add breadcrumbs to my site by following the breadcrumbs knowledge base article:

http://www.fogcreek.com/CityDesk/kb/howto/Breadcrumbs.html

I have added links in my "Extra 2" field as the article describes.  Is there a way that I can specifiy a class attribute for this link so that I end up with something like:

<a href="index.html" class="differentLinkStyle">Breadcrumbs Sample Site</a>

I need these links to appear differently than other links on my page.

Any ideas?

Thanks!

T.S.
Wednesday, October 01, 2003

Edit it in another article's body (I have a permenant "temp" article on my site in a hidden folder) in HTML view, then switch to Normal view and copy it, then paste it in the Extra2 field... Might work.

Mark T A W .com
Wednesday, October 01, 2003

By the way the "Create Breadcrumbs" article strikes me as a great "Why integrating legacy systems is always such a mess" example. Sure this strategy made sense at the time, but a site redesign, or change in the organization, or a real breadcrumb tool in version 3.x or 4.x or whatever will make this code obsolete. Not to mention the user having to maintain this all himself....

Mark T A W .com
Wednesday, October 01, 2003

"Not to mention the user having to maintain this all himself".... Well you don't have to, at least if your navigation is only 2-levels deep, CD can create breadcrumbs automatically.

We integrated that into our FORSSA Wizard (template), see here

http://discuss.fogcreek.com/CityDesk/default.asp?cmd=show&ixPost=9847&ixReplies=4

and Johan published pretty similar CityScript code to do that a couple of days later here

http://discuss.fogcreek.com/CityDesk/default.asp?cmd=show&ixPost=9881&ixReplies=1

for all those willing to code themselve.

Regards

Patrick

Patrick Thomas
Wednesday, October 01, 2003

Oh I see, that's pretty simple. I keep forgetting about CityDesk 2.x new stuff.

Mark T A W .com
Wednesday, October 01, 2003

T.S. :re Breadcrumb links with style

If you are going to use the code provided by "Johan" following [which I recommended you do – and which I have altered to include the class attribute]

<a class="bcrumb" href="PTMFOG0000000013">Home</a>
{$ foreach 1 x in (and thisFolder (fileName "index") not(keywordContains "HOME")) $} &gt; <a class="bcrumb" href="{$x.link$}">{$x.headline$}</a>{$ next $}
{$ foreach 1 x in (and thisArticle (not(filename "index"))) $} &gt; <a class="endTrail" {$ x.headline $}</a>{$ next $}

In your CSS:

a.bcrumbs:link, a.bcrumbs:visited, a.bcrumbs:hover, a.bcrumbs:active {font-size: .75em;  text-decoration: none; color: #008080;}

.endTrail{font-size: .75em;}

If However you want to follow the breadcrumbs example that’s provided in the fog creek knowledgebase [as in your reference] then the process to alter the style is somewhat more convoluted and in my opinion not necessary as "Johan's" model is significantly more efficient.

David Mozer
Wednesday, October 01, 2003

OOPS Typo in the code corrected as follows:

<a class="bcrumbs" href="PTMFOG0000000013">Tips Home</a>
{$ foreach 1 x in (and thisFolder (fileName "index") not(keywordContains "Hot Tips")) $} &#187; <a class="bcrumbs" href="{$x.link$}">{$x.headline$}</a>{$ next $}
{$ foreach 1 x in (and thisArticle (not(filename "index"))) $} &#187; <a class="endTrail">{$ x.headline $}</a>{$ next $}

Make sure to change the "magic name" above to whatever yours in fact is. :-)

The typo error I corrected is a missing > in the last foreach loop after class="endTrail"

David Mozer
Wednesday, October 01, 2003

Wow, that's exactly what I needed!  Thanks!

T.S.
Wednesday, October 01, 2003

*  Recent Topics

*  Fog Creek Home