diff --git a/app/controllers/front_controller.rb b/app/controllers/front_controller.rb
index 15a9d986..3648f6a4 100644
--- a/app/controllers/front_controller.rb
+++ b/app/controllers/front_controller.rb
@@ -3,7 +3,7 @@ class FrontController < ApplicationController
layout false
def show_breadcrumb
- @ancestors = Page.find(params[:menu_page_id]).ancestors_and_self.map{|m|m.title_translations[locale]}.delete_at(0) rescue []
+ @ancestors = Page.find(params[:page_id]).ancestors_and_self
@ancestors.delete_at(0)
end
diff --git a/app/views/front/show_breadcrumb.html.erb b/app/views/front/show_breadcrumb.html.erb
index afba97b2..7b0fc912 100644
--- a/app/views/front/show_breadcrumb.html.erb
+++ b/app/views/front/show_breadcrumb.html.erb
@@ -1,9 +1,9 @@
<% if not @ancestors.empty? %>
- <%= @ancestors.each do |node| %>
+ <% @ancestors.each do |node| %>
-
- <%= link_to node.title, (node.class.to_s.eql?('Page') ? '/' + node.path : node.url) %>
+ <%= link_to node.title, "/#{node.path}" %>
<% end %>
diff --git a/lib/parsers/parser_common.rb b/lib/parsers/parser_common.rb
index 0d139ba7..bd0b8643 100644
--- a/lib/parsers/parser_common.rb
+++ b/lib/parsers/parser_common.rb
@@ -156,9 +156,7 @@ module ParserCommon
res << "
"
ancestors.each do |node|
res << "- "
- # root = "/"
- # res << "#{child.title}"
- res << "#{node}"
+ res << " body.to_html})
end
@@ -92,6 +93,20 @@ module ParserFrontEnd
end
end
+ # page_breadcrumb
+ def parse_breadcrumb(body, page, site)
+ page_breadcrumb = body.css('.page_breadcrumb').first
+ if page_breadcrumb
+ res = ""
+ fragment = Nokogiri::HTML::DocumentFragment.new(body, res)
+ page_breadcrumb.swap(fragment)
+ else
+ ''
+ end
+ end
+
# page_contents
def parse_contents(body, page, edit=nil, locale)
public_r_tags = []
@@ -181,6 +196,6 @@ module ParserFrontEnd
# breadcrumb
def generate_breadcrumbs(*args)
- ""
+ ""
end
end