Breadcrumn except the root

Hi.

I’ve a page tree to handle a multilingual site:

/
/it/etc.
/en/etc.

How can I limit the breadcrumb tag so that it shows the language root
rather than the whole site root?

(I.e., instead of “My site > Italian home page > Altra pagina” or "“My
site > English home page > Other page”, it shows only "“English home
page > Other page”).

Thanks in advance.

Luigi

I wrote an extension with some custom tags, including this custom
breadcrumbs tag. It’s similar to the default one but I added 2
possible attribute: exclude and rename…and I use it in this way:

<r:bc:breadcrumbs separator=" > " exclude=“1” rename=“12=Home” />

It excludes the real homepage and rename my “Home ITA” to
“Home”…this is the code:

tag ‘bc:breadcrumbs’ do |tag|
pages_to_exclude = tag.attr[‘exclude’] ? tag.attr
[‘exclude’].split(’,’).collect{|id| id.strip.to_i} : []
renames = tag.attr[‘rename’] ? Hash[*tag.attr[‘rename’].split
(’,’).collect{|s| s.split(’=’).collect{|x| x.strip} }.flatten] : {}
page = tag.locals.page
breadcrumbs = renames[page.id.to_s] ? [renames[page.id.to_s]] :
[page.breadcrumb]
page.ancestors.each do |ancestor|
label = renames[ancestor.id.to_s] ? renames
[ancestor.id.to_s] : ancestor.breadcrumb
breadcrumbs.unshift %{#{label}}
unless pages_to_exclude.include?(ancestor.id)
end
separator = tag.attr[‘separator’] || ’ > ’
breadcrumbs.join(separator)
end

Il giorno 21/mag/07, alle ore 14:47, Luigi R. ha scritto:

Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant


Andrea F.

[email protected]
http://bigchieflabs.com/blog/
http://think.bigchief.it

Andrea F. wrote:

I wrote an extension with some custom tags, including this custom
breadcrumbs tag. It’s similar to the default one but I added 2
possible attribute: exclude and rename…and I use it in this way:

It works perfectly. Grazie!

Luigi

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs