Skip to content

Commit

Permalink
MERC-4566 Add option to hide breadcrumbs and page title
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Chu committed Feb 14, 2019
1 parent e77e420 commit e3e3834
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 14 deletions.
5 changes: 5 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
"Firefox ESR"
],
"settings": {
"page_heading": false,
"breadcrumbs": false,
"blog_page_heading": false,
"category_page_heading": false,
"contact_us_page_heading": false,
"homepage_new_products_count": 5,
"homepage_featured_products_count": 4,
"homepage_top_products_count": 4,
Expand Down
34 changes: 34 additions & 0 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,40 @@
"label": "Product thumbnail loading background",
"id": "container-fill-base"
},
{
"type": "heading",
"content": "Pages"
},
{
"type": "checkbox",
"label": "Hide breadcrumbs",
"force_reload": true,
"id": "breadcrumbs"
},
{
"type": "checkbox",
"label": "Hide page heading",
"force_reload": true,
"id": "page_heading"
},
{
"type": "checkbox",
"label": "Hide category page heading",
"force_reload": true,
"id": "category_page_heading"
},
{
"type": "checkbox",
"label": "Hide blog page heading",
"force_reload": true,
"id": "blog_page_heading"
},
{
"type": "checkbox",
"label": "Hide contact-us page heading",
"force_reload": true,
"id": "contact_us_page_heading"
},
{
"type": "heading",
"content": "Products"
Expand Down
20 changes: 11 additions & 9 deletions templates/components/common/breadcrumbs.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<ul class="breadcrumbs" itemscope itemtype="http://schema.org/BreadcrumbList">
{{#each breadcrumbs}}
<li class="breadcrumb {{#if @last}}is-active{{/if}}" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
{{#or @last (if url "==" null)}}
<meta itemprop="item" content="{{url}}">
<span class="breadcrumb-label" itemprop="name">{{name}}</span>
{{else}}
<a href="{{url}}" class="breadcrumb-label" itemprop="item"><span itemprop="name">{{name}}</span></a>
{{/or}}
<meta itemprop="position" content="{{add @index 1}}" />
</li>
{{#or (if ../theme_settings.breadcrumbs '!==' true)}}
<li class="breadcrumb {{#if @last}}is-active{{/if}}" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
{{#or @last (if url "==" null)}}
<meta itemprop="item" content="{{url}}">
<span class="breadcrumb-label" itemprop="name">{{name}}</span>
{{else}}
<a href="{{url}}" class="breadcrumb-label" itemprop="item"><span itemprop="name">{{name}}</span></a>
{{/or}}
<meta itemprop="position" content="{{add @index 1}}" />
</li>
{{/or}}
{{/each}}
</ul>
4 changes: 3 additions & 1 deletion templates/pages/blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
{{> components/common/breadcrumbs breadcrumbs=breadcrumbs}}

<main class="page">
<h1 class="page-heading">{{ blog.name }}</h1>
{{#or (if ../theme_settings.blog_page_heading '!==' true)}}
<h1 class="page-heading">{{ blog.name }}</h1>
{{/or}}

{{#each blog.posts}}
{{> components/blog/post post=this}}
Expand Down
4 changes: 3 additions & 1 deletion templates/pages/category.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
{{#if category.image}}
<img class="lazyload" data-sizes="auto" src="{{cdn 'img/loading.svg'}}" data-src="{{getImage category.image 'zoom_size'}}">
{{/if}}
<h1 class="page-heading">{{category.name}}</h1>
{{#or (if ../theme_settings.category_page_heading '!==' true)}}
<h1 class="page-heading">{{category.name}}</h1>
{{/or}}
{{{category.description}}}
{{{snippet 'categories'}}}
<div class="page">
Expand Down
4 changes: 3 additions & 1 deletion templates/pages/contact-us.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

<main class="page">

<h1 class="page-heading">{{page.title}}</h1>
{{#or (if ../theme_settings.contact_us_page_heading '!==' true)}}
<h1 class="page-heading">{{page.title}}</h1>
{{/or}}

{{#if page.sub_pages}}
<nav class="navBar navBar--sub">
Expand Down
5 changes: 3 additions & 2 deletions templates/pages/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
{{> components/common/breadcrumbs breadcrumbs=breadcrumbs}}

<main class="page">

<h1 class="page-heading">{{ page.title }}</h1>
{{#or (if ../theme_settings.page_heading '!==' true)}}
<h1 class="page-heading">{{ page.title }}</h1>
{{/or}}

{{#if page.sub_pages}}
<nav class="navBar navBar--sub">
Expand Down

0 comments on commit e3e3834

Please sign in to comment.