Re: Add Link to Featured Collection Title; Dawn Theme!

Solved

Add Link to Featured Collection Title; Dawn Theme!

thatsmydawg
Tourist
9 0 2

Hello! I would like to know if its possible to make the Featured Collection heading a link so that you can click it and go to that collection. Any help appreciated 🙏🏽

Accepted Solution (1)

lunaworks
Shopify Partner
449 44 47

This is an accepted solution.

In the featured-collection.liquid file on line 52, you'll see this

<h2 class="title {{ section.settings.heading_size }}">{{ section.settings.title | escape }}</h2>

 

replace it with

{%- if section.settings.title != blank and section.settings.heading_url == nil -%}
<h2 class="title {{ section.settings.heading_size }}">{{ section.settings.title | escape }}</h2>
{%- endif -%}
{% if section.settings.heading_url != blank and section.settings.heading_url != blank %}
<a href="{{ section.settings.heading_url }}" class="title {{ section.settings.heading_size }}" >{{ section.settings.title }}</a>
{% endif %}

 

Then you scroll down to the schema below this code,

{
"type": "text",
"id": "title",
"default": "Featured collection",
"label": "t:sections.featured-collection.settings.title.label"
},


right after the comma add this code

{
"type": "url",
"id": "heading_url",
"label": "URL for heading"
},
If my solution fixed your issue, please mark my solution as solved.
In need of custom solutions? Please DM.

View solution in original post

Replies 4 (4)

lunaworks
Shopify Partner
449 44 47

This is an accepted solution.

In the featured-collection.liquid file on line 52, you'll see this

<h2 class="title {{ section.settings.heading_size }}">{{ section.settings.title | escape }}</h2>

 

replace it with

{%- if section.settings.title != blank and section.settings.heading_url == nil -%}
<h2 class="title {{ section.settings.heading_size }}">{{ section.settings.title | escape }}</h2>
{%- endif -%}
{% if section.settings.heading_url != blank and section.settings.heading_url != blank %}
<a href="{{ section.settings.heading_url }}" class="title {{ section.settings.heading_size }}" >{{ section.settings.title }}</a>
{% endif %}

 

Then you scroll down to the schema below this code,

{
"type": "text",
"id": "title",
"default": "Featured collection",
"label": "t:sections.featured-collection.settings.title.label"
},


right after the comma add this code

{
"type": "url",
"id": "heading_url",
"label": "URL for heading"
},
If my solution fixed your issue, please mark my solution as solved.
In need of custom solutions? Please DM.
thatsmydawg
Tourist
9 0 2

Amazing!! Thanks so much! That worked 🙏🏽🙏🏽

One small problem, I had the Featured Collection headings centered above the carousel and when I added the URL to titles in theme customizer they all went back to original left side position.. any way to get them back centered while keeping the link ? Thanks so much so far for all your help! 🙏🏽🙌🏽

kimiannstevens
New Member
4 0 0

How do you get this to be centered? How do you show without it underlined? My text was centered prior to adding the above code.

Mitnick
New Member
5 0 0

Hi there.  Would this be the same on version 11?