How can I link a collection slider title to its respective collection?

Hello

How can I make the collection slider section Title link to its respective collection. Please note the collection and the section title are not necessarily the same as you can see from the screenshot you can edit the name of the section title. I want to be able to click on the section title and it links to the collection its displaying.

Website link: https://www.homegrownmkt.com/pages/women

@nalnowaeam
Hii,
Its Customization Work

So can you please share your store Details
I will check code and provide proper solution
Thanks

This is the code for the collection slider section. We need to add a link to section.settings.title to be the link of the collection that is chosen in section.settings.collection_main

{% assign collection_main = collections[section.settings.collection_main] %}
{% assign collection_limit = section.settings.collection_limit %}

{% assign cell_align = section.settings.cell_align %}
{% assign wrap_around = section.settings.wrap_around %}
{% assign img_width = section.settings.img_width | append: 'x' %}

  ## {{ section.settings.title }}
  
    {% for product in collection_main.products limit: collection_limit %}
      {%- if product.metafields.inventory.ShappifyHidden == 'true' -%}{%- continue -%}{%- endif -%}
      {% assign first_variant = product.selected_or_first_available_variant %}
      {% assign featured_img_src=first_variant.featured_img.src | default: product.featured_image.src %}
      {% assign price = first_variant.price %}
      {% assign compare_at_price = first_variant.compare_at_price %}
      

        

          
            

              
            

            ### {{ product.title }}
          
        

      
 
	{% endfor %}
   

{% schema %}
{
"name": "Collection Slider",
"settings": [
{
"type": "collection",
"id": "collection_main",
"label": "Choose a Collection"
},
{
"type": "range",
"id": "collection_limit",
"min": 2,
"max": 50,
"step": 1,
"unit": ".",
"label": "How many products to show",
"default": 4
},
{
"type": "color",
"id": "bg",
"label": "Background Color"
},
{
"type": "text",
"id": "title",
"label": "Title",
"default": "Featured Collection Slider"
},
{
"type": "range",
"id": "img_width",
"min": 250,
"max": 600,
"step": 5,
"unit": "px",
"label": "Image Width",
"default": 250
},
{
"type": "select",
"id": "cell_align",
"label": "Slide Alignment",
"options": [
{
"value": "center",
"label": "Center"
},
{
"value": "left",
"label": "Left"
}
],
"default": "center"
},
{
"type": "range",
"id": "title_mb",
"min": 30,
"max": 120,
"step": 1,
"unit": "px",
"label": "Title Margin Bottom",
"default": 48
},
{
"type": "select",
"id": "cell_width",
"label": "Choose number of slides to show on start",
"options": [
{
"value": "25%",
"label": "Four"
},
{
"value": "20%",
"label": "Five"
},
{
"value": "16.6666667%",
"label": "Six"
},
{
"value": "12.5%",
"label": "Eight"
}
],
"default": "25%"
},
{
"type": "radio",
"id": "wrap_around",
"label": "Enable Wrap Around (endless scrolling)",
"options": [
{
"value": "true",
"label": "True"
},
{
"value": "false",
"label": "False"
}
],
"default": "true"
}
],
"presets": [
{
"name": "Collection Slider",
"category": "Slider"
}
]
}
{% endschema %}

@nalnowaeam
please replace code

{% assign collection_main = collections[section.settings.collection_main] %}
{% assign collection_limit = section.settings.collection_limit %}

{% assign cell_align = section.settings.cell_align %}
{% assign wrap_around = section.settings.wrap_around %}
{% assign img_width = section.settings.img_width | append: 'x' %}

  ## {%if  section.setting.heading_link != blank%}{{ section.settings.title }}{%else%}{{ section.settings.title }}{%endif%}
  
    {% for product in collection_main.products limit: collection_limit %}
      {%- if product.metafields.inventory.ShappifyHidden == 'true' -%}{%- continue -%}{%- endif -%}
      {% assign first_variant = product.selected_or_first_available_variant %}
      {% assign featured_img_src=first_variant.featured_img.src | default: product.featured_image.src %}
      {% assign price = first_variant.price %}
      {% assign compare_at_price = first_variant.compare_at_price %}
      

        

          
            

              
            

            ### {{ product.title }}
          
        

      
 
	{% endfor %}
   

{% schema %}
{
"name": "Collection Slider",
"settings": [
{
"type": "collection",
"id": "collection_main",
"label": "Choose a Collection"
},
{
"type": "range",
"id": "collection_limit",
"min": 2,
"max": 50,
"step": 1,
"unit": ".",
"label": "How many products to show",
"default": 4
},
{
"type": "color",
"id": "bg",
"label": "Background Color"
},
{
"type": "text",
"id": "title",
"label": "Title",
"default": "Featured Collection Slider"
},
{
"type": "url",
"id": "heading_link",
"label": "Link"
},
{
"type": "range",
"id": "img_width",
"min": 250,
"max": 600,
"step": 5,
"unit": "px",
"label": "Image Width",
"default": 250
},
{
"type": "select",
"id": "cell_align",
"label": "Slide Alignment",
"options": [
{
"value": "center",
"label": "Center"
},
{
"value": "left",
"label": "Left"
}
],
"default": "center"
},
{
"type": "range",
"id": "title_mb",
"min": 30,
"max": 120,
"step": 1,
"unit": "px",
"label": "Title Margin Bottom",
"default": 48
},
{
"type": "select",
"id": "cell_width",
"label": "Choose number of slides to show on start",
"options": [
{
"value": "25%",
"label": "Four"
},
{
"value": "20%",
"label": "Five"
},
{
"value": "16.6666667%",
"label": "Six"
},
{
"value": "12.5%",
"label": "Eight"
}
],
"default": "25%"
},
{
"type": "radio",
"id": "wrap_around",
"label": "Enable Wrap Around (endless scrolling)",
"options": [
{
"value": "true",
"label": "True"
},
{
"value": "false",
"label": "False"
}
],
"default": "true"
}
],
"presets": [
{
"name": "Collection Slider",
"category": "Slider"
}
]
}
{% endschema %}

That did not work at all

The title needs to always link to the collection its linked. so once the title its clicked it will take me to the respective collection. Nothing happens when I click the title after editing the code.

@nalnowaeam

please Update only “H2” code

## 
    {%if  section.settings.heading_link != blank %}
    {{ section.settings.title }}    
    {% else %}{{ section.settings.title }}
    {% endif %}