app/helpers/maglev/page_preview_helper.rb in maglevcms-1.1.7 vs app/helpers/maglev/page_preview_helper.rb in maglevcms-1.2.0
- old
+ new
@@ -14,14 +14,18 @@
).tap { |component| component.view_context = self }.render.html_safe
end
# rubocop:enable Rails/OutputSafety
def render_maglev_section(type, site: nil, theme: nil, page: nil, page_sections: nil)
+ sections = (page_sections || maglev_page_sections).find_all do |section|
+ (section['type'] || section[:type]).start_with?(type.to_s)
+ end
+
render_maglev_sections(
site: site,
theme: theme,
page: page,
- page_sections: (page_sections || maglev_page_sections).find_all { |section| section['type'] == type.to_s }
+ page_sections: sections
)
end
def render_maglev_alternate_links(links: nil, x_default_locale: nil)
links ||= maglev_page_fullpaths