-
Notifications
You must be signed in to change notification settings - Fork 4
Home
simonc edited this page Apr 9, 2012
·
5 revisions
Renders the breadcrumb like this:
<p class="breadcrumb">
<a href="/">Home</a> / Other
</p>You can pass the following options when creating an HTML renderer:
-
active_classthe class to use on the activeli(default:'active') -
dividerthe separator string (inherited from Base as' / ') -
link_activeif true, the active item will be a link, simple text otherwise (default:false) -
link_classthe class used for every link in the breadcrumb (default:nil) -
list_classthe class used by the breadcrumb container (default:'breadcrumb') -
list_idthe id used by the breadcrumb container (default:nil)
Renders the breadcrumb like this: (default and compatible with Twitter Bootstrap)
<ul class="breadcrumb">
<li>
<a href="/">Home</a>
<span class="divider">/</span>
</li>
<li class="active">Other</li>
</ul>You can pass the following options when creating an HTMLList renderer:
-
active_classthe class to use on the activeli(inherited from HTML as'active') -
dividerthe separator string (default:'<span class="divider">/</span>') -
item_classclass used by alllielements (default: nil) -
link_activeif true, the active item will be a link, simple text otherwise (inherited from HTML asfalse) -
link_classthe class used for every link in the breadcrumb (inherited from HTML asnil) -
list_classthe class used by the breadcrumb container (inherited from HTML as'breadcrumb') -
list_idthe id used by the breadcrumb container (inherited from HTML asnil)
On my last project, I had to use schema.org. Here is what I did:
class SchemaorgHTMLList < Ariane::Render::HTMLList
def list(crumbs)
content_tag(:ul, id: options[:list_id], class: options[:list_class], itemprop: 'breadcrumb') do
raw items(crumbs)
end
end
end
Ariane.configure do |config|
config.default_renderer = SchemaorgHTMLList
endAnd it produced the following HTML:
<ul class="breadcrumb" itemprop="breadcrumb">
<li>
<a href="/">Home</a>
<span class="divider>/</span>
</li>
<li class="active">Other</li>
</ul>