How to make an icon block clickable?

Hi,

I’m trying to make this item block clickable but not sure where to insert the href link.

Does anyone have an idea?

Thanks

Calum

Datasheets<\/a>
"730efe0b-e1b3-4b40-a8b7-719dc9f38ffd": {
      "type": "text-with-icons",
      "blocks": {
        "template--15935874990244__730efe0b-e1b3-4b40-a8b7-719dc9f38ffd-1675851819a37dfda1-0": {
          "type": "item",
          "settings": {
            "icon": "bi-delivery",
            "custom_icon": "shopify:\/\/shop_images\/screw-icon-01-01.png",
            "title": "METSEC",
            "content": "" 
          }
        }

Attached code I’m trying to use and image of the items I want clickable. Thanks

You need to add href tag around the actual block, not around the schema tag. Scroll up and look for that div or a button you are trying to make clickable.

“730efe0b-e1b3-4b40-a8b7-719dc9f38ffd”: {
“type”: “text-with-icons”,
“blocks”: {
“template–15935874990244__730efe0b-e1b3-4b40-a8b7-719dc9f38ffd-1675851819a37dfda1-0”: {
“type”: “item”,
“settings”: {
“icon”: “bi-delivery”,
“custom_icon”: “shopify://shop_images/screw-icon-01-01.png”,
“title”: “METSEC”,

“link”: “link.com
“content”: “”
}
}

YOU DIV OR BUTTON

Please use this variant, forgot the comma

“730efe0b-e1b3-4b40-a8b7-719dc9f38ffd”: {
“type”: “text-with-icons”,
“blocks”: {
“template–15935874990244__730efe0b-e1b3-4b40-a8b7-719dc9f38ffd-1675851819a37dfda1-0”: {
“type”: “item”,
“settings”: {
“icon”: “bi-delivery”,
“custom_icon”: “shopify://shop_images/screw-icon-01-01.png”,
“title”: “METSEC”,

“link”: “link.com”,
“content”: “”
}
}

YOU DIV OR BUTTON

Thanks a lot!

So when you say around the block is that still somewhere in here?

{
  "sections": {
    "main": {
      "type": "main-page",
      "settings": {
      }
    },
    "730efe0b-e1b3-4b40-a8b7-719dc9f38ffd": {
      "type": "text-with-icons",
      "blocks": {
        "template--15935874990244__730efe0b-e1b3-4b40-a8b7-719dc9f38ffd-1675851819a37dfda1-0": {
          "type": "item",
          "settings": {
            "icon": "bi-delivery",
            "custom_icon": "shopify:\/\/shop_images\/screw-icon-01-01.png",
            "title": "METSEC",
            "link": "https://cdn.shopify.com/s/files/1/0623/3872/8100/files/MEF_-_Unistrut_-_Flytec_Under_Screed_Data.pdf?v=1675695369",
            "content": "" 
          }
        }

Sorry forget that!

Would it be in the customiser or in the code editor?

Hi,

No. What you have sent is the Schema. You need to find html code for that button or block you are trying to make clickable.

By the way, that`s a bit odd that you write all the data in the schema itself. Is there a reason behind this?

Send me a code of the page you are working on and I will tell you where to put that code.

Thanks - I’m just not sure where to access the HTML from the page/template I’m working on. You can see it is mainly editable from the customiser. I’m not sure what file has the HTML?

Go to Online Store → Themes → *** → Edit Code. Create a duplicate beforehand.

In the search field type datasheets

Send the code you have there

No problem - the Datasheets template is

{
  "sections": {
    "main": {
      "type": "main-page",
      "settings": {
      }
    },
    "730efe0b-e1b3-4b40-a8b7-719dc9f38ffd": {
      "type": "text-with-icons",
      "blocks": {
        "template--15935874990244__730efe0b-e1b3-4b40-a8b7-719dc9f38ffd-1675851819a37dfda1-0": {
          "type": "item",
          "settings": {
            "icon": "bi-delivery",
            "custom_icon": "shopify:\/\/shop_images\/screw-icon-01-01.png",
            "title": "METSEC",
            "content": ""
          }
        },
        "template--15935874990244__730efe0b-e1b3-4b40-a8b7-719dc9f38ffd-1675851819a37dfda1-1": {
          "type": "item",
          "settings": {
            "icon": "bi-delivery",
            "custom_icon": "shopify:\/\/shop_images\/gear-icon-01-01.png",
            "title": "UNISTRUT",
            "content": ""
          }
        },
        "template--15935874990244__730efe0b-e1b3-4b40-a8b7-719dc9f38ffd-1675851819a37dfda1-2": {
          "type": "item",
          "settings": {
            "icon": "bi-delivery",
            "custom_icon": "shopify:\/\/shop_images\/data-icon3-01.png",
            "title": "STRUTFOOT",
            "content": ""
          }
        },
        "template--15935874990244__730efe0b-e1b3-4b40-a8b7-719dc9f38ffd-1675851819a37dfda1-3": {
          "type": "item",
          "settings": {
            "icon": "bi-delivery",
            "custom_icon": "shopify:\/\/shop_images\/data-icon2-01.png",
            "title": "METPRO",
            "content": ""
          }
        }
      },
      "block_order": [
        "template--15935874990244__730efe0b-e1b3-4b40-a8b7-719dc9f38ffd-1675851819a37dfda1-0",
        "template--15935874990244__730efe0b-e1b3-4b40-a8b7-719dc9f38ffd-1675851819a37dfda1-1",
        "template--15935874990244__730efe0b-e1b3-4b40-a8b7-719dc9f38ffd-1675851819a37dfda1-2",
        "template--15935874990244__730efe0b-e1b3-4b40-a8b7-719dc9f38ffd-1675851819a37dfda1-3"
      ],
      "custom_css": [

      ],
      "settings": {
        "stack_mobile": true
      }
    },
    "8899d16b-3ab1-4077-b2c4-6464d57ac495": {
      "type": "text-with-icons",
      "blocks": {
        "template--15935874990244__8899d16b-3ab1-4077-b2c4-6464d57ac495-1675851819a37dfda1-0": {
          "type": "item",
          "settings": {
            "icon": "bi-delivery",
            "title": "FLEXICON",
            "content": ""
          }
        },
        "template--15935874990244__8899d16b-3ab1-4077-b2c4-6464d57ac495-1675851819a37dfda1-1": {
          "type": "item",
          "settings": {
            "icon": "bi-delivery",
            "custom_icon": "shopify:\/\/shop_images\/screws-icon-01.png",
            "title": "WALRAVEN",
            "content": ""
          }
        },
        "d1b61eef-f61b-414a-aa7c-8779ee4d65e3": {
          "type": "item",
          "settings": {
            "icon": "bi-delivery",
            "custom_icon": "shopify:\/\/shop_images\/gear-icon-01-01.png",
            "title": "RAPID SADDLE",
            "content": ""
          }
        },
        "9ef02907-f70f-453d-96ed-a172adf29892": {
          "type": "item",
          "settings": {
            "icon": "bi-delivery",
            "custom_icon": "shopify:\/\/shop_images\/data-icon2-01.png",
            "title": "LINDAPTER",
            "content": ""
          }
        }
      },
      "block_order": [
        "template--15935874990244__8899d16b-3ab1-4077-b2c4-6464d57ac495-1675851819a37dfda1-0",
        "template--15935874990244__8899d16b-3ab1-4077-b2c4-6464d57ac495-1675851819a37dfda1-1",
        "d1b61eef-f61b-414a-aa7c-8779ee4d65e3",
        "9ef02907-f70f-453d-96ed-a172adf29892"
      ],
      "settings": {
        "stack_mobile": true
      }
    },
    "058d6bf7-2708-412f-80e3-a3220c415a83": {
      "type": "text-with-icons",
      "blocks": {
        "d9fe95d0-b146-4358-81d8-dab38df1c2c3": {
          "type": "item",
          "settings": {
            "icon": "bi-delivery",
            "title": "TAPCON",
            "content": ""
          }
        },
        "d9692d47-71ed-45d0-b542-57fbc6260c70": {
          "type": "item",
          "settings": {
            "icon": "bi-delivery",
            "custom_icon": "shopify:\/\/shop_images\/screws-icon-01.png",
            "title": "MARCO",
            "content": ""
          }
        },
        "0ffda8b0-fcdb-4671-a02b-00fa99256aa6": {
          "type": "item",
          "settings": {
            "icon": "bi-delivery",
            "custom_icon": "shopify:\/\/shop_images\/data-icon4-01.png",
            "title": "BOWMET",
            "content": ""
          }
        },
        "2d15204f-cee9-4c9b-829c-51d8223e8df7": {
          "type": "item",
          "settings": {
            "icon": "bi-delivery",
            "custom_icon": "shopify:\/\/shop_images\/data-icon2-01.png",
            "title": "FISCHER",
            "content": ""
          }
        }
      },
      "block_order": [
        "d9fe95d0-b146-4358-81d8-dab38df1c2c3",
        "d9692d47-71ed-45d0-b542-57fbc6260c70",
        "0ffda8b0-fcdb-4671-a02b-00fa99256aa6",
        "2d15204f-cee9-4c9b-829c-51d8223e8df7"
      ],
      "settings": {
        "stack_mobile": true
      }
    }
  },
  "order": [
    "main",
    "730efe0b-e1b3-4b40-a8b7-719dc9f38ffd",
    "8899d16b-3ab1-4077-b2c4-6464d57ac495",
    "058d6bf7-2708-412f-80e3-a3220c415a83"
  ]
}

Are you sure that`s all you have there?

Yes, in the templates folder. They are all JSON files I don’t see where I could edit HTML?

Is there anything before the {% schema %} starts?

I would also check the Text with Icons widget`s code. Look for text-with-icons or summat in your files

Nothing else on Datasheets.Json…this is the text with icons.liquid code


{% schema %}
{
  "name": "Text with icons",
  "max_blocks": 4,
  "settings": [
    {
      "type": "checkbox",
      "id": "stack_mobile",
      "label": "Stack on mobile",
      "default": false
    }
  ],
  "blocks": [
    {
      "type": "item",
      "name": "Item",
      "settings": [
        {
          "type": "select",
          "id": "icon",
          "label": "Icon",
          "options": [
            {
              "value": "bi-add-to-cart",
              "label": "Add to cart",
              "group": "Shop"
            },
            {
              "value": "bi-gift-wrap",
              "label": "Gift wrap",
              "group": "Shop"
            },
            {
              "value": "bi-gift-box",
              "label": "Gift box",
              "group": "Shop"
            },
            {
              "value": "bi-heart",
              "label": "Heart",
              "group": "Shop"
            },
            {
              "value": "bi-ecology",
              "label": "Ecology",
              "group": "Shop"
            },
            {
              "value": "bi-plant",
              "label": "Plant",
              "group": "Shop"
            },
            {
              "value": "bi-shop",
              "label": "Shop",
              "group": "Shop"
            },
            {
              "value": "bi-shop-pin",
              "label": "Shop with pin",
              "group": "Shop"
            },
            {
              "value": "bi-alert",
              "label": "Alert",
              "group": "Communication"
            },
            {
              "value": "bi-chat",
              "label": "Chat",
              "group": "Communication"
            },
            {
              "value": "bi-comment",
              "label": "Comment",
              "group": "Communication"
            },
            {
              "value": "bi-customer-support",
              "label": "Customer support",
              "group": "Communication"
            },
            {
              "value": "bi-email",
              "label": "Email",
              "group": "Communication"
            },
            {
              "value": "bi-network",
              "label": "Network",
              "group": "Communication"
            },
            {
              "value": "bi-newsletter",
              "label": "Newsletter",
              "group": "Communication"
            },
            {
              "value": "bi-love",
              "label": "Love",
              "group": "Communication"
            },
            {
              "value": "bi-phone",
              "label": "Phone",
              "group": "Communication"
            },
            {
              "value": "bi-share",
              "label": "Share",
              "group": "Communication"
            },
            {
              "value": "bi-delivery",
              "label": "Delivery",
              "group": "Delivery"
            },
            {
              "value": "bi-fast-delivery",
              "label": "Fast delivery",
              "group": "Delivery"
            },
            {
              "value": "bi-returns",
              "label": "Returns",
              "group": "Delivery"
            },
            {
              "value": "bi-time",
              "label": "Time",
              "group": "Delivery"
            },
            {
              "value": "bi-secure-payment",
              "label": "Secure payment",
              "group": "Security"
            },
            {
              "value": "bi-mobile-payment",
              "label": "Mobile payment",
              "group": "Security"
            },
            {
              "value": "bi-computer-payment",
              "label": "Computer payment",
              "group": "Security"
            },
            {
              "value": "bi-credit-card",
              "label": "Credit card",
              "group": "Security"
            },
            {
              "value": "bi-shield",
              "label": "Shield",
              "group": "Security"
            }
          ],
          "default": "bi-customer-support"
        },
        {
          "type": "image_picker",
          "id": "custom_icon",
          "label": "Custom icon",
          "info": "60 x 60px .png with transparency recommended"
        },
        {
          "type": "text",
          "id": "title",
          "label": "Heading",
          "default": "Your title"
        },
        {
          "type": "richtext",
          "id": "content",
          "label": "Content",
          "default": "

Short content about your store

"
        }
      ]
    }
  ],
  "presets": [
    {
      "category": "Text",
      "name": "Text with icons",
      "blocks": [
        {
          "type": "item",
          "settings": {
            "icon": "bi-delivery",
            "title": "Free delivery worldwide"
          }
        },
        {
          "type": "item",
          "settings": {
            "icon": "bi-returns",
            "title": "Satisfied or refunded"
          }
        },
        {
          "type": "item",
          "settings": {
            "icon": "bi-customer-support",
            "title": "Top-notch support"
          }
        },
        {
          "type": "item",
          "settings": {
            "icon": "bi-secure-payment",
            "title": "Secure payments"
          }
        }
      ]
    }
  ]
}
{% endschema %}

Right.

Please replace this code in the text-with-icons.liquid


{% schema %}
{
  "name": "Text with icons",
  "max_blocks": 4,
  "settings": [
    {
      "type": "checkbox",
      "id": "stack_mobile",
      "label": "Stack on mobile",
      "default": false
    }
  ],
  "blocks": [
    {
      "type": "item",
      "name": "Item",
      "settings": [
        {
          "type": "select",
          "id": "icon",
          "label": "Icon",
          "options": [
            {
              "value": "bi-add-to-cart",
              "label": "Add to cart",
              "group": "Shop"
            },
            {
              "value": "bi-gift-wrap",
              "label": "Gift wrap",
              "group": "Shop"
            },
            {
              "value": "bi-gift-box",
              "label": "Gift box",
              "group": "Shop"
            },
            {
              "value": "bi-heart",
              "label": "Heart",
              "group": "Shop"
            },
            {
              "value": "bi-ecology",
              "label": "Ecology",
              "group": "Shop"
            },
            {
              "value": "bi-plant",
              "label": "Plant",
              "group": "Shop"
            },
            {
              "value": "bi-shop",
              "label": "Shop",
              "group": "Shop"
            },
            {
              "value": "bi-shop-pin",
              "label": "Shop with pin",
              "group": "Shop"
            },
            {
              "value": "bi-alert",
              "label": "Alert",
              "group": "Communication"
            },
            {
              "value": "bi-chat",
              "label": "Chat",
              "group": "Communication"
            },
            {
              "value": "bi-comment",
              "label": "Comment",
              "group": "Communication"
            },
            {
              "value": "bi-customer-support",
              "label": "Customer support",
              "group": "Communication"
            },
            {
              "value": "bi-email",
              "label": "Email",
              "group": "Communication"
            },
            {
              "value": "bi-network",
              "label": "Network",
              "group": "Communication"
            },
            {
              "value": "bi-newsletter",
              "label": "Newsletter",
              "group": "Communication"
            },
            {
              "value": "bi-love",
              "label": "Love",
              "group": "Communication"
            },
            {
              "value": "bi-phone",
              "label": "Phone",
              "group": "Communication"
            },
            {
              "value": "bi-share",
              "label": "Share",
              "group": "Communication"
            },
            {
              "value": "bi-delivery",
              "label": "Delivery",
              "group": "Delivery"
            },
            {
              "value": "bi-fast-delivery",
              "label": "Fast delivery",
              "group": "Delivery"
            },
            {
              "value": "bi-returns",
              "label": "Returns",
              "group": "Delivery"
            },
            {
              "value": "bi-time",
              "label": "Time",
              "group": "Delivery"
            },
            {
              "value": "bi-secure-payment",
              "label": "Secure payment",
              "group": "Security"
            },
            {
              "value": "bi-mobile-payment",
              "label": "Mobile payment",
              "group": "Security"
            },
            {
              "value": "bi-computer-payment",
              "label": "Computer payment",
              "group": "Security"
            },
            {
              "value": "bi-credit-card",
              "label": "Credit card",
              "group": "Security"
            },
            {
              "value": "bi-shield",
              "label": "Shield",
              "group": "Security"
            }
          ],
          "default": "bi-customer-support"
        },
        {
          "type": "image_picker",
          "id": "custom_icon",
          "label": "Custom icon",
          "info": "60 x 60px .png with transparency recommended"
        },
        {
          "type": "text",
          "id": "title",
          "label": "Heading",
          "default": "Your title"
        },
        {
          "type": "richtext",
          "id": "content",
          "label": "Content",
          "default": "

Short content about your store

"
        },
         {
          "type": "link",
          "id": "link",
          "label": "Link",
          "default": ""
        }
      ]
    }
  ],
  "presets": [
    {
      "category": "Text",
      "name": "Text with icons",
      "blocks": [
        {
          "type": "item",
          "settings": {
            "icon": "bi-delivery",
            "title": "Free delivery worldwide"
          }
        },
        {
          "type": "item",
          "settings": {
            "icon": "bi-returns",
            "title": "Satisfied or refunded"
          }
        },
        {
          "type": "item",
          "settings": {
            "icon": "bi-customer-support",
            "title": "Top-notch support"
          }
        },
        {
          "type": "item",
          "settings": {
            "icon": "bi-secure-payment",
            "title": "Secure payments"
          }
        }
      ]
    }
  ]
}
{% endschema %}

Save and go to Themes → Customize. Do you have an option to add a link?

Also, use the link attribute to the blocks you want to be clickable

{
  "sections": {
    "main": {
      "type": "main-page",
      "settings": {
      }
    },
    "730efe0b-e1b3-4b40-a8b7-719dc9f38ffd": {
      "type": "text-with-icons",
      "blocks": {
        "template--15935874990244__730efe0b-e1b3-4b40-a8b7-719dc9f38ffd-1675851819a37dfda1-0": {
          "type": "item",
          "settings": {
            "icon": "bi-delivery",
            "custom_icon": "shopify:\/\/shop_images\/screw-icon-01-01.png",
            "title": "METSEC",
            "link": "https://cdn.shopify.com/s/files/1/0623/3872/8100/files/MEF_-_Unistrut_-_Flytec_Under_Screed_Data.pdf?v=1675695369",
            "content": "" 
          }
        }

Let me know how it worked for you

Hey, thanks for the reply

for some reason I got this when I saved

My bad :grinning_face_with_smiling_eyes:

Please change to this. let me know if this helps.


{% schema %}
{
  "name": "Text with icons",
  "max_blocks": 4,
  "settings": [
    {
      "type": "checkbox",
      "id": "stack_mobile",
      "label": "Stack on mobile",
      "default": false
    }
  ],
  "blocks": [
    {
      "type": "item",
      "name": "Item",
      "settings": [
        {
          "type": "select",
          "id": "icon",
          "label": "Icon",
          "options": [
            {
              "value": "bi-add-to-cart",
              "label": "Add to cart",
              "group": "Shop"
            },
            {
              "value": "bi-gift-wrap",
              "label": "Gift wrap",
              "group": "Shop"
            },
            {
              "value": "bi-gift-box",
              "label": "Gift box",
              "group": "Shop"
            },
            {
              "value": "bi-heart",
              "label": "Heart",
              "group": "Shop"
            },
            {
              "value": "bi-ecology",
              "label": "Ecology",
              "group": "Shop"
            },
            {
              "value": "bi-plant",
              "label": "Plant",
              "group": "Shop"
            },
            {
              "value": "bi-shop",
              "label": "Shop",
              "group": "Shop"
            },
            {
              "value": "bi-shop-pin",
              "label": "Shop with pin",
              "group": "Shop"
            },
            {
              "value": "bi-alert",
              "label": "Alert",
              "group": "Communication"
            },
            {
              "value": "bi-chat",
              "label": "Chat",
              "group": "Communication"
            },
            {
              "value": "bi-comment",
              "label": "Comment",
              "group": "Communication"
            },
            {
              "value": "bi-customer-support",
              "label": "Customer support",
              "group": "Communication"
            },
            {
              "value": "bi-email",
              "label": "Email",
              "group": "Communication"
            },
            {
              "value": "bi-network",
              "label": "Network",
              "group": "Communication"
            },
            {
              "value": "bi-newsletter",
              "label": "Newsletter",
              "group": "Communication"
            },
            {
              "value": "bi-love",
              "label": "Love",
              "group": "Communication"
            },
            {
              "value": "bi-phone",
              "label": "Phone",
              "group": "Communication"
            },
            {
              "value": "bi-share",
              "label": "Share",
              "group": "Communication"
            },
            {
              "value": "bi-delivery",
              "label": "Delivery",
              "group": "Delivery"
            },
            {
              "value": "bi-fast-delivery",
              "label": "Fast delivery",
              "group": "Delivery"
            },
            {
              "value": "bi-returns",
              "label": "Returns",
              "group": "Delivery"
            },
            {
              "value": "bi-time",
              "label": "Time",
              "group": "Delivery"
            },
            {
              "value": "bi-secure-payment",
              "label": "Secure payment",
              "group": "Security"
            },
            {
              "value": "bi-mobile-payment",
              "label": "Mobile payment",
              "group": "Security"
            },
            {
              "value": "bi-computer-payment",
              "label": "Computer payment",
              "group": "Security"
            },
            {
              "value": "bi-credit-card",
              "label": "Credit card",
              "group": "Security"
            },
            {
              "value": "bi-shield",
              "label": "Shield",
              "group": "Security"
            }
          ],
          "default": "bi-customer-support"
        },
        {
          "type": "image_picker",
          "id": "custom_icon",
          "label": "Custom icon",
          "info": "60 x 60px .png with transparency recommended"
        },
        {
          "type": "text",
          "id": "title",
          "label": "Heading",
          "default": "Your title"
        },
        {
          "type": "richtext",
          "id": "content",
          "label": "Content",
          "default": "

Short content about your store

"
        },
         {
          "type": "text",
          "id": "link",
          "label": "Link",
          "default": ""
        }
      ]
    }
  ],
  "presets": [
    {
      "category": "Text",
      "name": "Text with icons",
      "blocks": [
        {
          "type": "item",
          "settings": {
            "icon": "bi-delivery",
            "title": "Free delivery worldwide"
          }
        },
        {
          "type": "item",
          "settings": {
            "icon": "bi-returns",
            "title": "Satisfied or refunded"
          }
        },
        {
          "type": "item",
          "settings": {
            "icon": "bi-customer-support",
            "title": "Top-notch support"
          }
        },
        {
          "type": "item",
          "settings": {
            "icon": "bi-secure-payment",
            "title": "Secure payments"
          }
        }
      ]
    }
  ]
}
{% endschema %}

Cheers - now I just get this error