Showing
2 changed files
with
7 additions
and
3 deletions
| ... | ... | @@ -124,7 +124,8 @@ module Kanjai |
| 124 | 124 | |
| 125 | 125 | page_collection.each do |page| |
| 126 | 126 | if page.children.length > 0 and next_level |
| 127 | - subparts << item[:source] | |
| 127 | + subparts << item[:source].to_s.gsub('###link###', page.menu_url(session[:scheme], lang = nil)) | |
| 128 | + .gsub('###title###', page.lang_attributes(I18n.locale, :title)) | |
| 128 | 129 | |
| 129 | 130 | self.menu_generator(session, domain, next_level[:children], subparts, nil, false, page) |
| 130 | 131 | else |
| ... | ... | @@ -153,7 +154,10 @@ module Kanjai |
| 153 | 154 | else |
| 154 | 155 | attributes = item[:attributes] |
| 155 | 156 | if current_page |
| 156 | - p attributes | |
| 157 | + attributes = replace_attributes_marker(attributes, { | |
| 158 | + '###link###' => current_page.menu_url(session[:scheme], lang = nil), | |
| 159 | + '###title###' => current_page.lang_attributes(I18n.locale, :title) | |
| 160 | + }) | |
| 157 | 161 | end |
| 158 | 162 | subparts.send(item[:name].to_s, attributes) do |next_subparts| |
| 159 | 163 | self.menu_generator(session, domain, item[:children], next_subparts, nil, start_from_current_page, current_page) | ... | ... |