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 %{<a href="#{ancestor.url}">#{label}</a>}
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 Rizzo ha scritto:
> 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
> _______________________________________________
> Radiant mailing list
> Post: [email protected]
> Search: http://radiantcms.org/mailing-list/search/
> Site: http://lists.radiantcms.org/mailman/listinfo/radiant
-----
Andrea Franz
[EMAIL PROTECTED]
http://bigchieflabs.com/blog/
http://think.bigchief.it
_______________________________________________
Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant