I have decided to try out the jQuery plugin ‘jCrumb’. What i am a little stuck with is how to add my own image as a separator and how to control the name of the breadcrumb it generates.
So I downloaded jCrumb from http://www.somethinghitme.com/projects/jCrumb/index.html?t=JCrumb%20Page%203
and you can pass options through a function
(function($){
$.fn.jCrumb = function(options) {
var settings = {
maxCrumbs : 4,
maxMemory : 15,
defaultClass : 'jCrumb',
jqUI : false,
seperator : ">"
},
the breadcrumbs work ok, as in it follows my navigation, but rather than show the breadcrumbs as this for example
Home / News / Contact
they show like this
Nameofmysite | Home > nameofmysite | News > nameofmysite | Contact Us
Where is the plugin getting the info from and how would i change it to just
Home / News / Contact Us
edit
The title is taken from this method
def title
base_title = "Newbridges"
if @title.nil?
base_title
else
"#{base_title} | #{@title}"
end
end
How would i get the plugin to ignore the base title?
Edit
The title is set using this section in the plugin
setCrumb(document.title + '^' + window.location.href);
var crumbs = getCrumbs(),
crumbVal = "",
crumbList = $(document.createElement('ul')).addClass(settings.defaultClass).appendTo($(this)),
crumbListItem = "";
if(settings.jqUI){
crumbList.addClass('fg-buttonset fg-buttonset-single ui-helper-clearfix');
}
if(crumbs){
crumbs = crumbs.split('*');
startIndex = 0;
I am developing the site in rails, not sure if that makes a difference to any option i have
Any help appreciated
Thanks
The use of
document.titleis hardcoded into the jCrumb plugin, which means it will take whatever is set by Rails.So you have two options:
Either change your
titlemethod in Rails so it does not prepend the site name to the document title:…or extend or modify the jCrumb plugin so that instead of
document.titleit usesdocument.title.split(" | ")[1].