Skip to content
Snippets Groups Projects
Commit b3ee4408 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

Fix #1423

parent d727f889
No related branches found
No related tags found
No related merge requests found
......@@ -145,6 +145,10 @@ class Communication::Block::Template::Base
false
end
def heading_title
block.title
end
def to_s
self.class.to_s.demodulize
end
......
......@@ -29,6 +29,11 @@ class Communication::Block::Template::Page < Communication::Block::Template::Bas
selected_pages
end
def heading_title
block.title.present? ? block.title
: page&.title
end
protected
def selected_pages_selection
......
......@@ -4,8 +4,8 @@ module Communication::Block::WithHeadingRanks
DEFAULT_HEADING_LEVEL = 2 # h1 is the page title
def heading_rank_self
title.present? ? heading_rank_base
: false
template.heading_title.present? ? heading_rank_base
: false
end
def heading_rank_children
......
......@@ -5,7 +5,7 @@ should_render_data = block.data && block.data.present?
- kind: block
template: <%= block.template_kind %>
title: >-
<%= prepare_text_for_static block.title %>
<%= prepare_text_for_static block.template.heading_title %>
position: <%= block.position %>
ranks:
self: <%= block.heading_rank_self %>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment