Have you ever wanted a breadcrumb trail on your blog? Most themes for Serendipity don't include a breadcrumb, my conversion of andreas06 includes one, and you could easily add one to any theme.
Giving your users an extra cue to help them navigate around your blog enhances usability, could help with your SEO initiatives, and definitely looks very groovy. The following Smarty code is ready to be copied and pasted directly into your Serendipity blog theme, and could be placed above your site header, just above your content, or even in the footer of your page.
Please be aware that this code does not include any formatting so it will adopt the standard text and link formatting of your theme. You could easily add a container div around the breadcrumb trail code which would allow you to add styles specifically tailored to your look and feel.
<a href="{$serendipityBaseURL}">{$CONST.HOMEPAGE}</a>
{if $head_title && !$entry.title | $head_title != $entry.title}
{if $entry.title}»{/if} {$category.category_name}
{elseif $head_title && $entry.title}
{if $category.category_name}
» <a href="{$category.category_link}" title="{$category.category_description}">
{$category.category_name}</a>
{/if}
{if $entry.title == $head_title}
» {$entry.title|truncate:40:" ...":true}
{/if}
{elseif $head_subtitle}
» {$head_subtitle}
{/if}
{if $staticpage_pagetitle && !$entry.title}
» {$staticpage_headline}
{/if}
The first line of this code creates the link back to your blog homepage. Many users of blogs may not be aware that they can click somewhere else to return to your homepage, especially with themes that obfuscate the homepage link within the banner. The Smarty variable {$CONST.HOMEPAGE} provides the homepage text. The homepage text is defined in the Serendipity language files so users whose langauge is supported by Serendipity should see a translation of this expression.
Volker said,
Monday, February 26. 2007 at 14:34 (Reply)
To refer to categories, (array)$category_info must be used instead of (int)$category as stated in the online docs over at http://www.s9y.org/102.html#A33
Here's the corrected source-code, including an unlinked startpage entry on the ...ähm... startpage
{if $startpage}
{$CONST.HOMEPAGE}
{else}
{$CONST.HOMEPAGE}
{/if}
{if $head_title && !$entry.title | $head_title != $entry.title}
{if $entry.title}» {$category_info.category_name}{/if}
{elseif $head_title && $entry.title}
{if $category_info.category_name}
» {$category_info.category_name}
{/if}
{if $entry.title == $head_title}
» {$entry.title|truncate:40:" ...":true}
{/if}
{elseif $head_subtitle}
» {$head_subtitle}
{/if}
{if $staticpage_pagetitle && !$entry.title}
» {$staticpage_headline}
{/if}