Dawn Theme Hide Title on Page Template

Solved
Megan_Di_Giovan
New Member
3 0 0

I am trying to figure out in the new Dawn theme how to hide a title on an individual page template. 

I want to hide the title "HDL Star Rewards" from this page: https://www.hopedesignltd.com/pages/hdl-star-rewards-1

Thanks for the help. 

0 Likes
Pallavi
Shopify Expert
2382 397 515

This is an accepted solution.

Hello There,

1. In your Shopify Admin go to online store > themes > actions > edit code
2. Find Asset > theme.scss.liquid and paste this at the bottom of the file:

section#shopify-section-template--14168045518950__main {
display: none!important;
}

.spaced-section {
margin-top: 0!important;
}
Want to modify or develop new app, Hire us.
If helpful then please Like and Accept Solution .
Email: support@zestard.com
Shopify Apps URL :- https://apps.shopify.com/partners/zestard-technologies
Custom Modifications Into Shopify Theme | Shopify Private App | SEO & Digital Marketing
Ninthony
Shopify Partner
2242 338 895

This is an accepted solution.

Alternatively you could go into main-page.liquid in your sections folder and make a case statement with your page handle and assign a variable to be true if you want to hide the page, then use an unless statement around the title:

<link rel="stylesheet" href="{{ 'section-main-page.css' | asset_url }}" media="print" onload="this.media='all'">
<link rel="stylesheet" href="{{ 'component-rte.css' | asset_url }}" media="print" onload="this.media='all'">

<noscript>{{ 'section-main-page.css' | asset_url | stylesheet_tag }}</noscript>
<noscript>{{ 'component-rte.css' | asset_url | stylesheet_tag }}</noscript>

{% assign hide_page = false %}
{% case page.handle %}
  {% when 'hdl-star-rewards-1' %}
  {% assign hide_page = true %}
{% endcase %}


<div class="page-width page-width--narrow">
  <h1 class="main-page-title page-title h0">
    {% unless hide_page %}{{ page.title | escape }}{% endunless %}
  </h1>
  <div class="rte">
    {{ page.content }}
  </div>
</div>

{% schema %}
{
  "name": "t:sections.main-page.name",
  "tag": "section",
  "class": "spaced-section"
}
{% endschema %}


Then if you should need to hide it on any other pages in the future you can add to the case statement. Say you wanted to hide the title on your about-us page:

<link rel="stylesheet" href="{{ 'section-main-page.css' | asset_url }}" media="print" onload="this.media='all'">
<link rel="stylesheet" href="{{ 'component-rte.css' | asset_url }}" media="print" onload="this.media='all'">

<noscript>{{ 'section-main-page.css' | asset_url | stylesheet_tag }}</noscript>
<noscript>{{ 'component-rte.css' | asset_url | stylesheet_tag }}</noscript>

{% assign hide_page = false %}
{% case page.handle %}
  {% when 'hdl-star-rewards-1' %}
    {% assign hide_page = true %}
  {% when 'about-us' %}
    {% assign hide_page = true %}
{% endcase %}

<div class="page-width page-width--narrow">
  <h1 class="main-page-title page-title h0">
    {% unless hide_page %}{{ page.title | escape }}{% endunless %}
  </h1>
  <div class="rte">
    {{ page.content }}
  </div>
</div>

{% schema %}
{
  "name": "t:sections.main-page.name",
  "tag": "section",
  "class": "spaced-section"
}
{% endschema %}



If my solution helped you, please like it and accept it as the solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
Megan_Di_Giovan
New Member
3 0 0

Thanks! Both solutions work, but I ended up going with the second. 

0 Likes
ItzALifestyle
New Member
1 0 1

i cant find:

Asset > theme.scss.liquid

Can someone help please?

taitery
New Member
1 0 0

Asset > theme.scss.liquid does not exist in the Dawn theme. What would it be for this theme, specifically?

0 Likes
jaouad12
New Member
1 0 0

Hi @Pallavi 

I could not find (Asset > theme.scss.liquid) where to paste your suggested code to hide the default page title. I have a Theme.liquid file but it did not work out

Here is my website: https://consulting-for-good.myshopify.com/

I would really appreciate your help.

KR,

 

 

0 Likes