diff --git a/templates/courseformat/content/section/header.mustache b/templates/courseformat/content/section/header.mustache
index 2a4a951..fd865c0 100644
--- a/templates/courseformat/content/section/header.mustache
+++ b/templates/courseformat/content/section/header.mustache
@@ -36,6 +36,7 @@
{{/ core_courseformat/local/content/section/bulkselect }}
{{/sectionbulk}}
+{{^section.hidesectiontitle}}
{{#headerdisplaymultipage}}
{{{title}}}
@@ -56,3 +57,4 @@
{{/sitehome}}
{{/headerdisplaymultipage}}
+{{/section.hidesectiontitle}}
diff --git a/templates/section_layout.mustache b/templates/section_layout.mustache
index 5c4e2c2..d6830fd 100644
--- a/templates/section_layout.mustache
+++ b/templates/section_layout.mustache
@@ -94,20 +94,19 @@ data-target="{{#sectioncardcontentdirect}}_blank{{/sectioncardcontentdirect}}" d
{{/flowcourse}}
{{! Section name header }}
- {{^section.hidesectiontitle}}
-
- {{#singleheader}}
- {{$ format_designer/courseformat/content/section/header }}
- {{> format_designer/courseformat/content/section/header }}
- {{/ format_designer/courseformat/content/section/header }}
- {{/singleheader}}
- {{#header}}
- {{$ format_designer/courseformat/content/section/header }}
- {{> format_designer/courseformat/content/section/header }}
- {{/ format_designer/courseformat/content/section/header }}
- {{/header}}
-
- {{/section.hidesectiontitle}}
+
+ {{#singleheader}}
+ {{$ format_designer/courseformat/content/section/header }}
+ {{> format_designer/courseformat/content/section/header }}
+ {{/ format_designer/courseformat/content/section/header }}
+ {{/singleheader}}
+ {{#header}}
+ {{$ format_designer/courseformat/content/section/header }}
+ {{> format_designer/courseformat/content/section/header }}
+ {{/ format_designer/courseformat/content/section/header }}
+ {{/header}}
+
+
{{! End of section name }}
{{! Section badges }}