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 28, 2019
1 parent d92e2a0 commit 6e144d4
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 17 deletions.
5 changes: 5 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
"Firefox ESR"
],
"settings": {
"hide_breadcrumbs": false,
"hide_page_heading": false,
"hide_category_page_heading": false,
"hide_blog_page_heading": false,
"hide_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": "hide_breadcrumbs"
},
{
"type": "checkbox",
"label": "Hide page heading",
"force_reload": true,
"id": "hide_page_heading"
},
{
"type": "checkbox",
"label": "Hide category page heading",
"force_reload": true,
"id": "hide_category_page_heading"
},
{
"type": "checkbox",
"label": "Hide blog page heading",
"force_reload": true,
"id": "hide_blog_page_heading"
},
{
"type": "checkbox",
"label": "Hide contact us page heading",
"force_reload": true,
"id": "hide_contact_us_page_heading"
},
{
"type": "heading",
"content": "Products"
Expand Down
24 changes: 13 additions & 11 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>
{{/each}}
{{#unless theme_settings.hide_breadcrumbs }}
{{#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>
{{/each}}
{{/unless}}
</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>
{{#unless theme_settings.hide_blog_page_heading }}
<h1 class="page-heading">{{ blog.name }}</h1>
{{/unless}}

{{#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>
{{#unless theme_settings.hide_category_page_heading }}
<h1 class="page-heading">{{category.name}}</h1>
{{/unless}}
{{{category.description}}}
{{{snippet 'categories'}}}
<div class="page">
Expand Down
5 changes: 3 additions & 2 deletions templates/pages/contact-us.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>
{{#unless theme_settings.hide_contact_us_page_heading }}
<h1 class="page-heading">{{page.title}}</h1>
{{/unless}}

{{#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>
{{#unless theme_settings.hide_page_heading }}
<h1 class="page-heading">{{ page.title }}</h1>
{{/unless}}

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

0 comments on commit 6e144d4

Please sign in to comment.