Page 1 of 1

How to hide breadcrumb text for current page

Posted: Fri Aug 03, 2007 9:43 am
by Anastasis
Is it possible to hide the breadcrumb text for the current page?

So, for example if the current page is "Widgets" the breadcrumb would be:

Home > Products

rather than

Home > Products > Widgets

I have looked through the forum and also the help on breadcrumbs but couldn't find a how-to on this.

Re: How to hide breadcrumb text for current page

Posted: Fri Aug 03, 2007 3:36 pm
by Dr.CSS
Have you looked in the help for it?...

Since it is a tag you will change the 'module' to 'tag' in the verbiage below \/...

Re: How to hide breadcrumb text for current page

Posted: Fri Aug 03, 2007 4:00 pm
by Anastasis
mark wrote: Have you looked in the help for it?...

Since it is a tag you will change the 'module' to 'tag' in the verbiage below \/...
Mark

Thanks for your reply. Yes, as mentioned in my original post I did look in the help, but couldn't find anything in there to do what I want.

This is what the help says on the breadcrumbs tag:
What does this do?

Prints a breadcrumb trail .
How do I use it?

Just insert the tag into your template/page like: {breadcrumbs}
What parameters does it take?

    * (optional) delimiter - Text to seperate entries in the list (default ">>").
    * (optional) initial - 1/0 If set to 1 start the breadcrumbs with a delimiter (default 0).
    * (optional) root - Page alias of a page you want to always appear as the first page in the list. Can be used to make a page (e.g. the front page) appear to be the root of everything even though it is not.
    * (optional) root_url - Override the URL of the root page. Useful for making link be to '/' instead of '/home/'. This requires that the root page be set as the default page.
    * (optional) classid - The CSS class for the non current page names, i.e. the first n-1 pages in the list. If the name is a link it is added to the tags, otherwise it is added to the tags.
    * (optional) currentclassid - The CSS class for the tag surrounding the current page name.
    * (optional) starttext - Text to append to the front of the breadcrumbs list, something like "You are here".
Maybe I am missing something or misunderstanding what it says, but nowhere can I see a parameter that allows you to hide the current page as per my example above. Am I mistaken?

Re: How to hide breadcrumb text for current page

Posted: Fri Aug 03, 2007 5:41 pm
by Nullig
You could add a class with this:

* (optional) currentclassid - The CSS class for the tag surrounding the current page name.

Code: Select all

{breadcrumbs currentclassid='hide'}
Then style that class as hidden by adding this to your stylesheet:

Code: Select all

.hide {
  display: none;
}
Nullig

Re: How to hide breadcrumb text for current page

Posted: Fri Aug 03, 2007 6:22 pm
by Anastasis
Nullig - thanks for the explanation. Sorry I read that but it didn't twig that was what I needed - doh!

I added the code and CSS and it's almost perfect, except for the fact that the delimiter before the hidden current page name remains like this:

Home > Products >

I'm possibly missing something again, but I cannot see a way to suppress that as well.

Re: How to hide breadcrumb text for current page

Posted: Fri Aug 03, 2007 7:57 pm
by Nullig
Not sure how you'd eliminate the last delimiter, but you could change it to a space or something else using:

delimiter=" "
  or
delimiter="whatever you want"

in the tag.

Nullig

Re: How to hide breadcrumb text for current page

Posted: Fri Aug 03, 2007 10:02 pm
by Anastasis
Nullig wrote: Not sure how you'd eliminate the last delimiter, but you could change it to a space or something else using:

delimiter=" "
  or
delimiter="whatever you want"

in the tag.

Nullig
Yes, that's true, but then that means losing the delimiter between the other items. It's odd that the currentclassid selector doesn't allow the ability to also hide the last delimiter - seems like an oversight.

Anyway, thanks for your help nonetheless.

Re: How to hide breadcrumb text for current page

Posted: Sat Aug 04, 2007 7:20 pm
by SimonSchaufi
.lastitem{
  display:none;
}

this works