Skip to content

Commit

Permalink
add optional display title
Browse files Browse the repository at this point in the history
  • Loading branch information
hotdoy committed Dec 24, 2019
1 parent 452af00 commit b76b727
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
9 changes: 9 additions & 0 deletions blueprints/modular/modular.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ form:
header: 'Header'
default: 'Default'

header.display_title:
type: toggle
label: Display Title
highlight: false
default: false
options:
false: 'False'
true: 'True'

taxonomies:
unset@: true
fields:
Expand Down
8 changes: 7 additions & 1 deletion css/modular.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
z-index: 1000;
}

.modular__title{
text-align: center;
margin-bottom: 3rem;
}

.m-t{margin-top: var(--rhythm);}
.m-b{margin-bottom: var(--rhythm);}
.m-tb{margin-top: var(--rhythm);margin-bottom: var(--rhythm);}
Expand All @@ -16,4 +21,5 @@
.p-tb{padding-top: var(--rhythm);padding-bottom: var(--rhythm);}

.r-default{}
.r-header{margin-top: calc(var(--nav-height)*-1);}
.r-header{margin-top: calc(var(--nav-height)*-1);}

2 changes: 2 additions & 0 deletions templates/partials/modular.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{% set modular_class = modular_class|default('') %}
{% set modular_style = modular_style|default('') %}
{% set modular_reveal = modular_reveal|default(0) %}
{% set modular_display_title = modular_display_title|default(page.header.display_title) %}

{%- set margin -%}
{%- if page.header.margin == 'top' %}m-t
Expand Down Expand Up @@ -37,5 +38,6 @@ modular modular--{{ modular_name }}

<section class="{{ computed_modular_class }}" style="{{ computed_style }}"
{% if modular_reveal %}data-reveal="{{ modular_reveal }}"{% endif %}>
{% if modular_display_title %}<div class="site modular__title"><h2>{{ page.title }}</h2></div>{% endif %}
{% block modular_content %}{% endblock %}
</section>

0 comments on commit b76b727

Please sign in to comment.