43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# File 'app/helpers/cms/page_helper.rb', line 43
def render_breadcrumbs(options={})
start = options[:from_top] || 0
show_parent = options[:show_parent].nil? ? false : options[:show_parent]
ancestors = current_page.ancestors
items = []
ancestors[start..ancestors.size].each_with_index do |sec,i|
items << content_tag(:li,
link_to(h(sec.name), sec.actual_path),
(i == 0 ? {:class => "first"} : {}))
end
if !show_parent && current_page.section.path == current_page.path
items[items.size-1] = content_tag(:li, h(current_page.section.name))
else
items << content_tag(:li, h(current_page.page_title))
end
content_tag(:ul, "\n #{items.join("\n ")}\n", :class => "breadcrumbs")
end
|