How to Make a clickable image on homepage MINIMAL theme?

Solved
blurio
Tourist
5 0 1

Hello,

I am trying add image link and make the image clickable to "Image with Text" section in Minimal theme. Can someone help please?

0 Likes
Guleria
Shopify Partner
1255 263 346

This is an accepted solution.

Hello  

Edit file feature-row.liquid, you can find this file under sections
Replace whole code with this one

 

 

<div class="page-width feature-row">
  {% capture image_layout %}
    <div class="feature-row__item">
      {% if section.settings.image != blank %}
        <noscript>
          {{ section.settings.image | img_url: '640x640' | img_tag: section.settings.image.alt }}
        </noscript>

        {% capture img_id %}FeatureRowImage--{{ section.id }}{% endcapture %}
        {% capture img_wrapper_id %}FeatureRowImageWrapper--{{ section.id }}{% endcapture %}
        {% include 'image-style' with image: section.settings.image, width: 700, height: 640, wrapper_id: img_wrapper_id, img_id: img_id %}
        {%- assign img_url = section.settings.image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}
        <div id="{{ img_wrapper_id }}" class="feature-row__image-wrapper supports-js">
          <div style="padding-top:{{ 1 | divided_by: section.settings.image.aspect_ratio | times: 100}}%;">
            {% if section.settings.image_external_url != blank %}
            <a href="{{ section.settings.image_external_url }}">
            {% endif %}
            <img id="{{ img_id }}"
                 class="feature-row__image lazyload"
                 src="{{ section.settings.image | img_url: '300x300' }}"
                 data-src="{{ img_url }}"
                 data-widths="[180, 360, 540, 720, 900, 1080, 1296, 1512, 1728, 1944, 2048]"
                 data-aspectratio="{{ section.settings.image.aspect_ratio }}"
                 data-sizes="auto"
                 alt="{{ section.settings.image.alt | escape }}">
            {% if section.settings.image_external_url != blank %}
            </a>
            {% endif %}
          </div>
        </div>
      {% else %}
        {{ 'image' | placeholder_svg_tag: 'placeholder-svg' }}
      {% endif %}
    </div>
  {% endcapture %}

  <div class="feature-row">
    {% if section.settings.layout == 'left' %}
      {{ image_layout }}
    {% endif %}

    <div class="feature-row__item feature-row__text feature-row__text--{{ section.settings.layout }}">
      {% if section.settings.title != blank %}
        <h2>{{ section.settings.title | escape }}</h2>
      {% endif %}
      {% if section.settings.text != blank %}
        <div class="rte featured-row__subtext">{{ section.settings.text }}</div>
      {% endif %}
      {% if section.settings.button_label != blank and section.settings.button_link != blank %}
        <a href="{{ section.settings.button_link }}" class="btn">
          {{ section.settings.button_label | escape }}
        </a>
      {% endif %}
    </div>

    {% if section.settings.layout == 'right' %}
      {{ image_layout }}
    {% endif %}
  </div>
</div>



{% schema %}
{
  "name": {
    "cs": "Obrázek s textem",
    "da": "Billede med tekst",
    "de": "Foto mit Text",
    "en": "Image with text",
    "es": "Imagen con texto",
    "fi": "Kuva tekstillä",
    "fr": "Image avec texte",
    "hi": "टेक्स्ट वाली इमेज",
    "it": "Immagine con testo",
    "ja": "テキスト付き画像",
    "ko": "텍스트 포함 이미지",
    "nb": "Bilde med tekst",
    "nl": "Afbeelding met tekst",
    "pl": "Obraz z tekstem",
    "pt-BR": "Imagem com texto",
    "pt-PT": "Imagem com texto",
    "sv": "Bild med text",
    "th": "รูปภาพพร้อมข้อความ",
    "tr": "Metin içeren görsel",
    "vi": "Hình ảnh có chữ",
    "zh-CN": "带文本图片",
    "zh-TW": "附文字的圖片"
  },
  "class": "index-section",
  "settings": [
    {
      "type": "image_picker",
      "id": "image",
      "label": {
        "cs": "Obrázek",
        "da": "Billede",
        "de": "Foto",
        "en": "Image",
        "es": "Imagen",
        "fi": "Kuva",
        "fr": "Image",
        "hi": "इमेज",
        "it": "Immagine",
        "ja": "画像",
        "ko": "이미지",
        "nb": "Bilde",
        "nl": "Afbeelding",
        "pl": "Obraz",
        "pt-BR": "Imagem",
        "pt-PT": "Imagem",
        "sv": "Bild",
        "th": "รูปภาพ",
        "tr": "Görsel",
        "vi": "Hình ảnh",
        "zh-CN": "图片",
        "zh-TW": "圖片"
      }
    },
	{
      "type": "text",
      "id": "image_external_url",
      "label": {
        "en": "Image Exyernal Url"
      }
    },
    {
      "type": "select",
      "id": "layout",
      "label": {
        "cs": "Zarovnání obrázku",
        "da": "Justering af billede",
        "de": "Fotoausrichtung",
        "en": "Image alignment",
        "es": "Alineación de imagen",
        "fi": "Kuvan tasaus",
        "fr": "Alignement de l'image",
        "hi": "इमेज पंक्तिबद्ध करना",
        "it": "Allineamento immagine",
        "ja": "画像アラインメント",
        "ko": "이미지 정렬",
        "nb": "Bildejustering",
        "nl": "Afbeelding uitlijnen",
        "pl": "Wyrównanie obrazu",
        "pt-BR": "Alinhamento da imagem",
        "pt-PT": "Alinhamento da imagem",
        "sv": "Bildjustering",
        "th": "การจัดวางรูปภาพ",
        "tr": "Görsel hizalaması",
        "vi": "Căn chỉnh hình ảnh",
        "zh-CN": "图片对齐方式",
        "zh-TW": "圖片對齊"
      },
      "default": "left",
      "options": [
        {
          "value": "left",
          "label": {
            "cs": "Doleva",
            "da": "Venstre",
            "de": "Links",
            "en": "Left",
            "es": "Izquierda",
            "fi": "Vasen",
            "fr": "Gauche",
            "hi": "बाएँ",
            "it": "Sinistra",
            "ja": "左",
            "ko": "왼쪽",
            "nb": "Venstre",
            "nl": "Links",
            "pl": "Do lewej",
            "pt-BR": "Esquerda",
            "pt-PT": "Esquerda",
            "sv": "Vänster",
            "th": "ด้านซ้าย",
            "tr": "Sol",
            "vi": "Bên trái",
            "zh-CN": "左侧",
            "zh-TW": "左方"
          }
        },
        {
          "value": "right",
          "label": {
            "cs": "Doprava",
            "da": "Højre",
            "de": "Rechts",
            "en": "Right",
            "es": "Derecha",
            "fi": "Oikea",
            "fr": "Droite",
            "hi": "दाएँ",
            "it": "Destra",
            "ja": "右",
            "ko": "오른쪽",
            "nb": "Høyre",
            "nl": "Rechts",
            "pl": "Do prawej",
            "pt-BR": "Direita",
            "pt-PT": "Direita",
            "sv": "Höger",
            "th": "ด้านขวา",
            "tr": "Sağ",
            "vi": "Bên phải",
            "zh-CN": "右侧",
            "zh-TW": "右方"
          }
        }
      ]
    },
    {
      "type": "text",
      "id": "title",
      "label": {
        "cs": "Nadpis",
        "da": "Overskrift",
        "de": "Titel",
        "en": "Heading",
        "es": "Título",
        "fi": "Otsake",
        "fr": "Titre",
        "hi": "शीर्षक",
        "it": "Heading",
        "ja": "見出し",
        "ko": "제목",
        "nb": "Overskrift",
        "nl": "Kop",
        "pl": "Nagłówek",
        "pt-BR": "Título",
        "pt-PT": "Título",
        "sv": "Rubrik",
        "th": "ส่วนหัว",
        "tr": "Başlık",
        "vi": "Tiêu đề",
        "zh-CN": "标题",
        "zh-TW": "標題"
      },
      "default": {
        "cs": "Obrázek s textem",
        "da": "Billede med tekst",
        "de": "Foto mit Text",
        "en": "Image with text",
        "es": "Imagen con texto",
        "fi": "Kuva tekstillä",
        "fr": "Image avec texte",
        "hi": "टेक्स्ट वाली इमेज",
        "it": "Immagine con testo",
        "ja": "テキスト付き画像",
        "ko": "텍스트 포함 이미지",
        "nb": "Bilde med tekst",
        "nl": "Afbeelding met tekst",
        "pl": "Obraz z tekstem",
        "pt-BR": "Imagem com texto",
        "pt-PT": "Imagem com texto",
        "sv": "Bild med text",
        "th": "รูปภาพพร้อมข้อความ",
        "tr": "Metin içeren görsel",
        "vi": "Hình ảnh có chữ",
        "zh-CN": "带文本图片",
        "zh-TW": "附文字的圖片"
      }
    },
    {
      "type": "richtext",
      "id": "text",
      "label": {
        "cs": "Text",
        "da": "Tekst",
        "de": "Text",
        "en": "Text",
        "es": "Texto",
        "fi": "Teksti",
        "fr": "Texte",
        "hi": "टेक्स्ट",
        "it": "Testo",
        "ja": "テキスト",
        "ko": "텍스트",
        "nb": "Tekst",
        "nl": "Tekst",
        "pl": "Tekst",
        "pt-BR": "Texto",
        "pt-PT": "Texto",
        "sv": "Text",
        "th": "ข้อความ",
        "tr": "Metin",
        "vi": "Văn bản",
        "zh-CN": "文本",
        "zh-TW": "文字"
      },
      "default": {
        "cs": "<p>Zkombinujte velký text a obrázek, abyste zaměřili pozornost návštěvníků na zvolený produkt, kolekci či příspěvek na blogu. Pak můžete připojit podrobnosti o dostupnosti či stylu, nebo dokonce recenzi.</p>",
        "da": "<p>Kombiner stor tekst med et billede for at give dit valgte produkt, din valgte kollektion eller dit valgte blogopslag fokus. Tilføj oplysninger om tilgængelighed, stil og eventuelt også en anmeldelse.</p>",
        "de": "<p>Kombiniere große Schrift mit einem Foto, um einen Fokus auf dein ausgewähltes Produkt, die Kategorie oder einen Blogpost zu legen. Du kannst dann Details zur Verfügbarkeit und dem Style oder sogar eine Bewertung hinzufügen.</p>",
        "en": "<p>Pair large text with an image to give focus to your chosen product, collection, or blog post. Add details on availability, style, or even provide a review.</p>",
        "es": "<p>Vincula un texto largo con una imagen para dar visibilidad a tu producto, colección o artículo de blog seleccionados. Agrega detalles sobre disponibilidad, estilo, o incluso ofrece una reseña.</p>",
        "fi": "<p>Korosta valitsemaasi tuotetta, kokoelmaa tai blogijulkaisua lisäämällä kuvaan suuri teksti. Lisää saatavuustiedot, määritä tyyli tai näytä vaikkapa arvostelu.</p>",
        "fr": "<p>Ajoutez une image à un long texte pour mettre l'accent sur un produit de votre choix, une collection, ou un article de blog. Ajoutez des détails sur la disponibilité, le style, ou mettez un commentaire client en avant.</p>",
        "hi": "<p>अपने चुने हुए उत्पाद, कलेक्शन या ब्लॉग पोस्ट पर ध्यान देने के लिए छवि के साथ बड़े पाठ को पेयर करें. उपलब्धता, स्टाइल या यहां तक कि समीक्षा प्रदान करने पर विवरण जोड़ें.</p>",
        "it": "<p>Associa un testo di grandi dimensioni a un'immagine per dare importanza al prodotto, alla collezione o all'articolo del blog di tua scelta. Aggiungi dettagli sulla disponibilità, sullo stile o fornisci una recensione.</p>",
        "ja": "<p>あなたが選んだ商品、コレクション、またはブログ記事に注目を集めるため、大きなテキストと画像を組み合わせます。可用性、スタイル、またはレビュー提供についての詳細を追加します。</p>",
        "ko": "<p>이미지와 큰 텍스트를 짝지어 선택한 제품, 컬렉션, 블로그 게시판을 강조합니다. 사용 가능성, 스타일에 대한 자세한 정보를 추가하거나 리뷰를 제공합니다.</p>",
        "nb": "<p>Koble stor tekst med et bilde for å drive fokus mot det valgte produktet, samlingen eller blogginnlegget. Legg til detaljer om tilgjengelighet, stil eller vis frem en vurdering.</p>",
        "nl": "<p>Plaats een afbeelding bij grote stukken tekst om de aandacht op je gekozen product, collectie of blogpost te richten. Voeg details over beschikbaarheid en stijl toe of plaats een productrecensie.</p>",
        "pl": "<p>Połącz duży tekst z obrazem, aby skierować uwagę na wybrany produkt, kolekcję lub wpis na blogu. Dodaj szczegóły dotyczące dostępności, stylu lub nawet dołącz recenzję.</p>",
        "pt-BR": "<p>Emparelhe textos grandes com uma imagem para dar foco ao produto, coleção ou post do blog escolhido. Adicione detalhes sobre disponibilidade, estilo ou até mesmo um comentário.</p>",
        "pt-PT": "<p>Associe um texto grande a uma imagem para dar ênfase ao produto, coleção ou publicação no blogue que escolheu. Adicione detalhes sobre disponibilidade, estilo ou uma avaliação.</p>",
        "sv": "<p>Para ihop stor text med en bild för att ge fokus åt din valda produkt, kollektion eller blogginlägg. Lägg till information om tillgänglighet, stil eller tillhandahåll till och med en recension.</p>",
        "th": "<p>จับคู่ข้อความขนาดใหญ่กับรูปภาพเพื่อให้ความสำคัญกับสินค้า คอลเลกชัน หรือโพสต์บล็อกที่คุณเลือก เพิ่มรายละเอียดเกี่ยวกับความพร้อม สไตล์ หรือแม้กระทั่งเขียนรีวิว</p>",
        "tr": "<p>Geniş metni bir görselle eşleyerek seçtiğiniz ürüne, koleksiyona veya blog gönderisine dikkat çekin. Stok durumu, stil hakkındaki ayrıntıları ekleyin, hatta inceleme sağlayın.</p>",
        "vi": "<p>Ghép nối văn bản lớn với hình ảnh để làm nổi bật sản phẩm, bộ sưu tập hoặc bài viết blog đã chọn. Thêm chi tiết về tình trạng còn hàng, kiểu hoặc đưa ra đánh giá.</p>",
        "zh-CN": "<p>将大文本与图片配对,以便将焦点置于您选择的产品、产品系列或博客文章。添加有关可用性和样式的详细信息,甚至是提供评论。</p>",
        "zh-TW": "<p>大型文字搭配圖片,以便強調特定產品、商品系列或部落格貼文。您可以加上各種有關可用性、樣式的資料,甚至可以提供使用心得。</p>"
      }
    },
    {
      "type": "text",
      "id": "button_label",
      "label": {
        "cs": "Text tlačítka",
        "da": "Knaptekst",
        "de": "Button-Etikett",
        "en": "Button label",
        "es": "Etiqueta de botón",
        "fi": "Tekstipainike",
        "fr": "Texte du bouton",
        "hi": "बटन लेबल",
        "it": "Etichetta pulsante",
        "ja": "ボタンのラベル",
        "ko": "버튼 레이블",
        "nb": "Knappetikett",
        "nl": "Knoplabel",
        "pl": "Przycisk z etykietą",
        "pt-BR": "Etiqueta de botão",
        "pt-PT": "Etiqueta do botão",
        "sv": "Knappetikett",
        "th": "ป้ายกำกับปุ่ม",
        "tr": "Düğme etiketi",
        "vi": "Nhãn nút",
        "zh-CN": "按钮标签",
        "zh-TW": "按鈕標籤"
      }
    },
    {
      "type": "url",
      "id": "button_link",
      "label": {
        "cs": "Tlačítkový odkaz",
        "da": "Knaplink",
        "de": "Button-Link",
        "en": "Button link",
        "es": "Enlace de botón",
        "fi": "Painikelinkki",
        "fr": "Lien du bouton",
        "hi": "बटन लिंक",
        "it": "Link pulsante",
        "ja": "ボタンのリンク",
        "ko": "버튼 링크",
        "nb": "Kobling for knapp",
        "nl": "Knoplink",
        "pl": "Link przycisku",
        "pt-BR": "Link de botão",
        "pt-PT": "Ligação do botão",
        "sv": "Knapplänk",
        "th": "ลิงก์ปุ่ม",
        "tr": "Düğme bağlantısı",
        "vi": "Liên kết trên nút",
        "zh-CN": "按钮链接",
        "zh-TW": "按鈕連結"
      }
    }
  ],
  "presets": [
    {
      "name": {
        "cs": "Obrázek s textem",
        "da": "Billede med tekst",
        "de": "Foto mit Text",
        "en": "Image with text",
        "es": "Imagen con texto",
        "fi": "Kuva tekstillä",
        "fr": "Image avec texte",
        "hi": "टेक्स्ट वाली इमेज",
        "it": "Immagine con testo",
        "ja": "テキスト付き画像",
        "ko": "텍스트 포함 이미지",
        "nb": "Bilde med tekst",
        "nl": "Afbeelding met tekst",
        "pl": "Obraz z tekstem",
        "pt-BR": "Imagem com texto",
        "pt-PT": "Imagem com texto",
        "sv": "Bild med text",
        "th": "รูปภาพพร้อมข้อความ",
        "tr": "Metin içeren görsel",
        "vi": "Hình ảnh có chữ",
        "zh-CN": "带文本图片",
        "zh-TW": "附文字的圖片"
      },
      "category": {
        "cs": "Obrázek",
        "da": "Billede",
        "de": "Foto",
        "en": "Image",
        "es": "Imagen",
        "fi": "Kuva",
        "fr": "Image",
        "hi": "इमेज",
        "it": "Immagine",
        "ja": "画像",
        "ko": "이미지",
        "nb": "Bilde",
        "nl": "Afbeelding",
        "pl": "Obraz",
        "pt-BR": "Imagem",
        "pt-PT": "Imagem",
        "sv": "Bild",
        "th": "รูปภาพ",
        "tr": "Görsel",
        "vi": "Hình ảnh",
        "zh-CN": "图片",
        "zh-TW": "圖片"
      }
    }
  ]
}
{% endschema %}

 

 


Now save the file and check theme settings, you will find an option is available to put external url for image.  Add you url and now on click image will redirect to destination url

Thanks

Want to modify or custom changes on store hire me.
Email: guleriathakur43@gmail.com, Skype: navrocks1
If helpful then please Like and Accept Solution.
If you are happy and want to donate Click here (Its my paypal)
blurio
Tourist
5 0 1

Thank you very much

0 Likes
aaronvaz125
New Member
1 0 0

Hello,

thank you for the coding, it worked very well but I still have one more question. The coding only worked for one of my sections on my home page. I have a featured collection section that I was hoping it would work on but unfortunately, it didn't. My featured collection section consists of 3 photos with a small description and a shop now button. I was hoping to learn how to make those images clickable.

 

Thank you so much 

Aaron

0 Likes
Smicker39
Tourist
17 0 1

This didn't work for me. Was I supposed to get an extra function in my theme settings? Where am I supposed to put the url link for my homepage images please?

 

Smicker39_0-1610283790733.png

 

0 Likes