How do I make a button's href into a selected template / collection's page

How do I make a button's href into a selected template / collection's page

AndreNL
Shopify Partner
37 1 5

I'm trying to make my button so it can change it's page that can be selected inside of shopify itself. I just don't know which type is used for this.

 

I'm using the Ella Theme.

 

HTML:

<!-- Button -->
            <div class="button-container">
                <a href="{{ section.settings.shopify_page_url }}" class="custom-button"
                   style="background-color: {{ section.settings.button_color }}; color: {{ section.settings.button_text_color }};">
                    {{ section.settings.button_text }}
                </a>
            </div>

and I don't know how I would use liquid with this, can someone help I'll try to respond ASAP

 

Reply 1 (1)

AcidPi
Shopify Partner
61 14 16

Hi @AndreNL,

section.settgins.<id> refers to the section input settings that you can change via theme editor.
Defined in the section schema - settings at the bottom of liquid file.

shopify_page_url
is the id and the type will most likely be url.

 

{
  "type": "url",
  "id": "shopify_page_url",
  "label": "Button link"
}

 

Regards