Re: HELP: Trying to change the size of "text columns with images"

Solved

HELP: Trying to change the size of "text columns with images"

oncewilddesigns
Tourist
7 0 2

I am looking to make the part on my site that says "Shop the collections" smaller. I'm using the "text columns with images" section for this. Currently, there are 4 collections, but I would like to make the collections about 1/2 the size that they are right now so that all 4 sit on a single row on the web version, and 2x2 on the mobile version. It's taking up way too much space right now.

My site is www.oncewilddesigns.com 

Here's my code for feature-columns.liquid:

 

Click to expand...
<div class="page-width">
  {% if section.settings.title != blank %}
    <div class="section-header text-center">
      <h2>{{ section.settings.title | escape }}</h2>
    </div>
  {% endif %}

  <div class="grid {% unless section.blocks.size == 5 %}grid--uniform{% endunless %} grid--flush-bottom">
    {%- assign grid_item_width = 'medium-up--one-third' -%}
    {%- assign max_height = 345 -%}
    {% case section.blocks.size %}
      {% when 1 %}
        {%- assign grid_item_width = 'medium-up--one-half' -%}
        {%- assign max_height = 530 -%}
      {% when 2 %}
        {%- assign grid_item_width = 'medium-up--one-half' -%}
        {%- assign max_height = 530 -%}
      {% when 4 %}
        {%- assign grid_item_width = 'medium-up--one-half' -%}
        {%- assign max_height = 530 -%}
    {% endcase %}
    {% for block in section.blocks %}
      {% if section.blocks.size == 5 and forloop.index < 3 %}
        {%- assign column_width = 'medium-up--one-half' -%}
        {%- assign max_height = 530 -%}
      {% else %}
        {%- assign column_width = grid_item_width -%}
      {% endif %}
      <div class="grid__item {{ column_width }} text-{{ section.settings.align_text }}" {{ block.shopify_attributes }}>
        {% if block.settings.enable_image %}
          {% if block.settings.image != blank %}
            {% capture img_id %}TextColumnImage-{{ block.id }}{% endcapture %}
            {% capture wrapper_id %}TextColumnImageWrapper-{{ block.id }}{% endcapture %}
            {%- assign img_url = block.settings.image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}
            {% include 'image-style', image: block.settings.image, height: max_height, wrapper_id: wrapper_id, img_id: img_id %}
            <div id="{{ wrapper_id }}" class="feature-row__image-wrapper js">
              <div style="padding-top:{{ 1 | divided_by: block.settings.image.aspect_ratio | times: 100}}%;">
                <img id="{{ img_id }}"
                     class="feature-row__image lazyload"
                     src="{{ block.settings.image | img_url: '300x300' }}"
                     data-src="{{ img_url }}"
                     data-widths="[180, 360, 540, 720, 900, 1080, 1296, 1512, 1728, 2048]"
                     data-aspectratio="{{ block.settings.image.aspect_ratio }}"
                     data-sizes="auto"
                     alt="{{ block.settings.image.alt | escape }}">
              </div>
            </div>
            <noscript>
              <p>
                {{ block.settings.image | img_url: '480x480', scale: 2 | img_tag: block.settings.image.alt, 'feature-row__image' }}
              </p>
            </noscript>
          {% else %}
            <p>
              {{ 'image' | placeholder_svg_tag: 'placeholder-svg' }}
            </p>
          {% endif %}
        {% endif %}
        {% if block.settings.title != blank %}
          <h3 class="h4">{{ block.settings.title | escape }}</h3>
        {% endif %}
        {% if block.settings.text != blank %}
          <div class="rte-setting">{{ block.settings.text }}</div>
        {% endif %}

        {% if block.settings.button_label != blank and block.settings.button_link != blank %}
          {%- capture ariaLabel -%}
            {{- block.settings.button_label -}}
            {%- if block.settings.button_link.type == 'frontpage_link' -%}
              : {{ 'homepage.general.title' | t -}}
            {%- elsif block.settings.button_link.type == 'catalog_link' -%}
              : {{ 'collections.catalog.title' | t -}}
            {%- elsif block.settings.button_link.object.title -%}
              : {{ block.settings.button_link.object.title -}}
            {%- endif -%}
          {%- endcapture -%}

          <a href="{{ block.settings.button_link }}"
            class="btn btn--secondary btn--small"
            aria-label="{{ ariaLabel | escape }}">
            {{- block.settings.button_label | escape -}}
          </a>
        {% endif %}
      </div>
    {% endfor %}
  </div>

  {% if section.blocks.size == 0 %}
    {% include 'no-blocks' %}
  {% endif %}
</div>



{% schema %}
{
  "name": {
    "da": "Tekstkolonner med billeder",
    "de": "Textspalten mit Fotos",
    "en": "Text columns with images",
    "es": "Col. de texto e imágenes",
    "fi": "Tekstisarakkeet kuvilla",
    "fr": "Colonnes de texte et images",
    "hi": "इमेज के साथ टेक्स्ट कॉलम",
    "it": "Colonne di testo con foto",
    "ja": "画像付きテキスト列",
    "ko": "이미지 포함 텍스트 열",
    "nb": "Tekstkolonner med bilder",
    "nl": "Kolom met afbeeldingen",
    "pt-BR": "Texto em coluna com imagens",
    "pt-PT": "Colunas texto c/ imagens",
    "sv": "Textkolumner med bilder",
    "th": "คอลัมน์ข้อความพร้อมรูปภาพ",
    "zh-CN": "带有图片的文本列",
    "zh-TW": "附圖片的文字欄"
  },
  "class": "index-section",
  "settings": [
    {
      "type": "text",
      "id": "title",
      "label": {
        "da": "Overskrift",
        "de": "Titel",
        "en": "Heading",
        "es": "Título",
        "fi": "Otsake",
        "fr": "En-tête",
        "hi": "शीर्षक",
        "it": "Heading",
        "ja": "見出し",
        "ko": "제목",
        "nb": "Overskrift",
        "nl": "Kop",
        "pt-BR": "Título",
        "pt-PT": "Título",
        "sv": "Rubrik",
        "th": "ส่วนหัว",
        "zh-CN": "标题",
        "zh-TW": "標題"
      },
      "default": {
        "da": "Tekstkolonner med billeder",
        "de": "Textspalten mit Fotos",
        "en": "Text columns with images",
        "es": "Col. de texto con imagen",
        "fi": "Tekstisarakkeet kuvilla",
        "fr": "Colonnes de texte et images",
        "hi": "इमेज के साथ टेक्स्ट कॉलम",
        "it": "Colonne di testo con foto",
        "ja": "画像付きテキスト列",
        "ko": "이미지 포함 텍스트 열",
        "nb": "Tekstkolonner med bilder",
        "nl": "Tekstkolommen met afbeeldingen",
        "pt-BR": "Texto em coluna com imagens",
        "pt-PT": "Colunas texto c/ imagens",
        "sv": "Textkolumner med bilder",
        "th": "คอลัมน์ข้อความพร้อมรูปภาพ",
        "zh-CN": "带有图片的文本列",
        "zh-TW": "附圖片的文字欄"
      }
    },
    {
      "type": "select",
      "id": "align_text",
      "label": {
        "da": "Tekstjustering",
        "de": "Textausrichtung",
        "en": "Text alignment",
        "es": "Alineación de texto",
        "fi": "Tekstin tasaus",
        "fr": "Alignement du texte",
        "hi": "टेक्स्ट पंक्तिबद्ध",
        "it": "Allineamento del testo",
        "ja": "テキストアラインメント",
        "ko": "텍스트 정렬",
        "nb": "Tekstjustering",
        "nl": "Tekstuitlijning",
        "pt-BR": "Alinhamento de texto",
        "pt-PT": "Alinhamento de texto",
        "sv": "Textjustering",
        "th": "การจัดตำแหน่งข้อความ",
        "zh-CN": "文本对齐方式",
        "zh-TW": "文字對齊"
      },
      "default": "left",
      "options": [
        {
          "value": "left",
          "label": {
            "da": "Venstre",
            "de": "Links",
            "en": "Left",
            "es": "Izquierda",
            "fi": "Vasen",
            "fr": "Gauche",
            "hi": "बाएँ",
            "it": "Sinistra",
            "ja": "左",
            "ko": "왼쪽",
            "nb": "Venstre",
            "nl": "Links",
            "pt-BR": "Esquerda",
            "pt-PT": "Esquerda",
            "sv": "Vänster",
            "th": "ด้านซ้าย",
            "zh-CN": "左侧",
            "zh-TW": "左方"
          }
        },
        {
          "value": "center",
          "label": {
            "da": "Centreret",
            "de": "Mittig",
            "en": "Centered",
            "es": "Centrado",
            "fi": "Keskitetty",
            "fr": "Centré",
            "hi": "केंद्र",
            "it": "Centrato",
            "ja": "中央揃え",
            "ko": "센터 맞추기",
            "nb": "Sentrert",
            "nl": "Gecentreerd",
            "pt-BR": "Centralizado",
            "pt-PT": "Centrado",
            "sv": "Centrera",
            "th": "ตรงกลาง",
            "zh-CN": "居中",
            "zh-TW": "置中"
          }
        }
      ]
    }
  ],
  "blocks": [
    {
      "type": "text_block",
      "name": {
        "da": "Kolonne",
        "de": "Spalte",
        "en": "Column",
        "es": "Columna",
        "fi": "Sarake",
        "fr": "Colonne",
        "hi": "कॉलम",
        "it": "Colonna",
        "ja": "列",
        "ko": "칼럼",
        "nb": "Kolonne",
        "nl": "Kolom",
        "pt-BR": "Coluna",
        "pt-PT": "Coluna",
        "sv": "Kolumn",
        "th": "คอลัมน์",
        "zh-CN": "列",
        "zh-TW": "欄"
      },
      "settings": [
        {
          "type": "checkbox",
          "id": "enable_image",
          "label": {
            "da": "Vis billede",
            "de": "Foto anzeigen",
            "en": "Show image",
            "es": "Mostrar imagen",
            "fi": "Näytä kuva",
            "fr": "Afficher l'image",
            "hi": "इमेज दिखाएं",
            "it": "Mostra immagine",
            "ja": "画像を表示する",
            "ko": "이미지 표시",
            "nb": "Vis bilde",
            "nl": "Toon afbeelding",
            "pt-BR": "Exibir imagem",
            "pt-PT": "Mostrar imagem",
            "sv": "Visa bild",
            "th": "แสดงรูปภาพ",
            "zh-CN": "显示图片",
            "zh-TW": "顯示圖片"
          },
          "default": true
        },
        {
          "type": "image_picker",
          "id": "image",
          "label": {
            "da": "Billede",
            "de": "Foto",
            "en": "Image",
            "es": "Imagen",
            "fi": "Kuva",
            "fr": "Image",
            "hi": "इमेज",
            "it": "Immagine",
            "ja": "画像",
            "ko": "이미지",
            "nb": "Bilde",
            "nl": "Afbeelding",
            "pt-BR": "Imagem",
            "pt-PT": "Imagem",
            "sv": "Bild",
            "th": "รูปภาพ",
            "zh-CN": "图片",
            "zh-TW": "圖片"
          }
        },
        {
          "type": "text",
          "id": "title",
          "label": {
            "da": "Overskrift",
            "de": "Titel",
            "en": "Heading",
            "es": "Título",
            "fi": "Otsake",
            "fr": "En-tête",
            "hi": "शीर्षक",
            "it": "Heading",
            "ja": "見出し",
            "ko": "제목",
            "nb": "Overskrift",
            "nl": "Kop",
            "pt-BR": "Título",
            "pt-PT": "Título",
            "sv": "Rubrik",
            "th": "ส่วนหัว",
            "zh-CN": "标题",
            "zh-TW": "標題"
          },
          "default": {
            "da": "Tilføj en titel eller et slogan",
            "de": "Titel oder Text hinzufügen",
            "en": "Add a title or tagline",
            "es": "Agregar un título o eslogan",
            "fi": "Lisää otsikko tai iskulause",
            "fr": "Ajouter un titre ou un slogan",
            "hi": "एक शीर्षक या टैगलाइन जोड़ें",
            "it": "Aggiungi un titolo o una tagline",
            "ja": "タイトルまたはキャッチコピーを追加する",
            "ko": "제목 또는 슬로건 추가",
            "nb": "Legg til en tittel eller er slagord",
            "nl": "Voeg een titel of een slogan toe",
            "pt-BR": "Adicione um título ou slogan",
            "pt-PT": "Adicionar título ou slogan",
            "sv": "Lägg till en titel eller tagline",
            "th": "เพิ่มชื่อเรื่องหรือสโลแกน",
            "zh-CN": "添加标题或标语",
            "zh-TW": "新增標題或標語"
          }
        },
        {
          "type": "richtext",
          "id": "text",
          "label": {
            "da": "Tekst",
            "de": "Text",
            "en": "Text",
            "es": "Texto",
            "fi": "Teksti",
            "fr": "Texte",
            "hi": "टेक्स्ट",
            "it": "Testo",
            "ja": "テキスト",
            "ko": "텍스트",
            "nb": "Tekst",
            "nl": "Tekst",
            "pt-BR": "Texto",
            "pt-PT": "Texto",
            "sv": "Text",
            "th": "ข้อความ",
            "zh-CN": "文本",
            "zh-TW": "文字"
          },
          "default": {
            "da": "<p>Del blogopslag, produkter eller reklamer med dine kunder. Brug denne tekst til at beskrive produkter, dele detaljer om tilgængelighed og stil eller som et sted til at vise dine seneste anmeldelser eller ofte stillede spørgsmål.</p>",
            "de": "<p>Blogposts, Produkte oder Promotions mit Ihren Kunden teilen. Nutzen Sie diesen Text, um Produkte zu beschreiben, Details zu Verfügbarkeit und Stil mitzuteilen oder als Ort, wo Reviews oder FAQs stehen.</p>",
            "en": "<p>Share blog posts, products, or promotions with your customers. Use this text to describe products, share details on availability and style, or as a space to display recent reviews or FAQs.</p>",
            "es": "<p>Comparte entradas de blogs, productos o promociones con tus clientes. Usa este texto para describir productos, compartir detalles sobre la disponibilidad y el estilo, o como un espacio para mostrar reseñas recientes o preguntas frecuentes.</p>",
            "fi": "<p>Jaa blogikirjoituksia, tuotteita tai kampanjoita asiakkaittesi kanssa. Tämän tekstin avulla voit kuvata tuotteita, jakaa saatavuutta ja tyyliä koskevia tietoja tai voit käyttää sitä tilana viimeisimpien arvosteluiden tai usein kysyttyjen kysymysten esittämiselle.</p>",
            "fr": "<p>Partagez des articles de blog, des produits ou des promotions avec vos clients. Utilisez ce texte pour décrire vos produits, partager des détails sur leur disponibilité ou leur style, ou encore pour afficher des FAQ et avis récents.</p>",
            "hi": "<p>अपने ग्राहकों के साथ ब्लॉग पोस्ट, उत्पाद या प्रचार शेयर करें. उत्पादों का वर्णन करने के लिए, उपलब्धता और स्टाइल पर विवरण शेयर करने के लिए, या हाल की समीक्षाओं या पूछे जाने वाले प्रश्न को प्रदर्शित करने के लिए एक स्थान के रूप में इस टेक्स्ट का उपयोग करें.</p>",
            "it": "<p>Condividi articoli del blog, prodotti o promozioni con i tuoi clienti. Utilizza questo spazio per descrivere i prodotti, condividendo dettagli sulla loro disponibilità e sul loro stile, oppure per mostrare recensioni recenti o domande frequenti.</p>",
            "ja": "<p>ブログ記事、商品、またはプロモーションをお客様に伝えます。このテキストで商品について説明し、出品状況やスタイルの詳細を共有するか、最近のレビューやFAQを表示するスペースとして使用します。</p>",
            "ko": "<p>블로그 게시물, 제품 또는 프로모션을 고객과 공유하십시오. 이 텍스트를 사용하여 제품을 설명하고 사용 가능성 및 스타일에 대한 세부 정보를 공유하거나 최근 리뷰 또는 FAQ를 표시할 수 있는 공간으로 사용하십시오.</p>",
            "nb": "<p>Del blogginnlegg, produkter eller kampanjer med kundene dine. Bruk denne teksten til å beskrive produkter, dele detaljer om tilgjengelighet og stil, eller som et sted for å vise de siste omtalene eller vanlige spørsmål.</p>",
            "nl": "<p>Deel blogposts, producten of promoties met je klanten. Gebruik deze tekst om producten te beschrijven, details over beschikbaarheid en stijl te delen of als een ruimte om recente beoordelingen of veelgestelde vragen weer te geven.</p>",
            "pt-BR": "<p>Compartilhe posts de blogs, produtos ou promoções com seus clientes. Use este texto para descrever produtos, compartilhar detalhes sobre disponibilidade e estilo ou como um espaço para exibir comentários recentes ou perguntas frequentes.</p>",
            "pt-PT": "<p>Partilhe publicações no blogue, produtos ou promoções com os seus clientes. Utilize este texto para descrever produtos, partilhar detalhes sobre disponibilidade e estilo ou como local para mostrar FAQ ou análises recentes.</p>",
            "sv": "<p>Dela blogginlägg, produkter eller kampanjer med dina kunder. Använd den här texten för att beskriva produkter, dela information om tillgänglighet och stil eller som ett utrymme för att visa senaste recensioner eller vanliga frågor.</p>",
            "th": "<p>แชร์โพสต์บล็อก สินค้า หรือโปรโมชันกับลูกค้าของคุณ ใช้ข้อความนี้เพื่ออธิบายสินค้า แชร์รายละเอียดเกี่ยวกับความพร้อมจำหน่ายและสไตล์ หรือเป็นพื้นที่เพื่อจัดแสดงรีวิวล่าสุด หรือว่าคำถามที่พบบ่อย</p>",
            "zh-CN": "<p>与您的客户分享博客文章、产品或促销信息。使用此文本描述产品、分享有关供货情况和风格的详细信息,或将此文本作为显示最近评论或常见问题解答的区域。</p>",
            "zh-TW": "<p>與顧客分享部落格貼文、產品或宣傳活動。請使用這段文字描述商品、分享庫存和樣式的詳細資訊,或顯示近期評論及常見問題。</p>"
          }
        },
        {
          "type": "text",
          "id": "button_label",
          "label": {
            "da": "Knaptekst",
            "de": "Button-Name",
            "en": "Button label",
            "es": "Etiqueta de botón",
            "fi": "Tekstipainike",
            "fr": "Texte du bouton",
            "hi": "बटन लेबल",
            "it": "Etichetta pulsante",
            "ja": "ボタンのラベル",
            "ko": "버튼 레이블",
            "nb": "Knappetikett",
            "nl": "Knoplabel",
            "pt-BR": "Etiqueta de botão",
            "pt-PT": "Etiqueta do botão",
            "sv": "Knappetikett",
            "th": "ป้ายกำกับปุ่ม",
            "zh-CN": "按钮标签",
            "zh-TW": "按鈕標籤"
          }
        },
        {
          "type": "url",
          "id": "button_link",
          "label": {
            "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",
            "pt-BR": "Link de botão",
            "pt-PT": "Ligação do botão",
            "sv": "Knapplänk",
            "th": "ลิงก์ปุ่ม",
            "zh-CN": "按钮链接",
            "zh-TW": "按鈕連結"
          }
        }
      ]
    }
  ],
  "presets": [
    {
      "name": {
        "da": "Tekstkolonner med billeder",
        "de": "Textspalten mit Fotos",
        "en": "Text columns with images",
        "es": "Col. de texto con imagen",
        "fi": "Tekstisarakkeet kuvilla",
        "fr": "Colonnes de texte et images",
        "hi": "इमेज के साथ टेक्स्ट कॉलम",
        "it": "Colonne di testo con foto",
        "ja": "画像付きテキスト列",
        "ko": "이미지 포함 텍스트 열",
        "nb": "Tekstkolonner med bilder",
        "nl": "Tekstkolommen met afbeeldingen",
        "pt-BR": "Texto em coluna com imagens",
        "pt-PT": "Colunas texto c/ imagens",
        "sv": "Textkolumner med bilder",
        "th": "คอลัมน์ข้อความพร้อมรูปภาพ",
        "zh-CN": "带有图片的文本列",
        "zh-TW": "附圖片的文字欄"
      },
      "category": {
        "da": "Tekst",
        "de": "Text",
        "en": "Text",
        "es": "Texto",
        "fi": "Teksti",
        "fr": "Texte",
        "hi": "टेक्स्ट",
        "it": "Testo",
        "ja": "テキスト",
        "ko": "텍스트",
        "nb": "Tekst",
        "nl": "Tekst",
        "pt-BR": "Texto",
        "pt-PT": "Texto",
        "sv": "Text",
        "th": "ข้อความ",
        "zh-CN": "文本",
        "zh-TW": "文字"
      },
      "blocks": [
        {
          "type": "text_block"
        },
        {
          "type": "text_block"
        },
        {
          "type": "text_block"
        }
      ]
    }
  ]
}
{% endschema %}

 

 

 

Accepted Solution (1)

oscprofessional
Shopify Partner
16116 2409 3125

This is an accepted solution.

Hello @oncewilddesigns,

PLease edit

oscprofessional_0-1594654256603.png

Please replace 

{%- assign grid_item_width = 'medium-up--one-half' -%}

 

with

{%- assign grid_item_width = 'small--one-half medium-up--one-quarter' -%}
Get pass your Store Core Web Vital Free Speed Optimization Audit, Chat on WhatsApp | Skype : oscprofessionals-87 | Email: pallavi@oscprofessionals.com | Hire us | Guaranteed Site Speed Optimization | Website Free Audit | Shopify Theme Customization | Build Shopify Private App | Shopify SEO | Digital Marketing | Oscp Upsell & Cross sell App : Free | Oscp Sales & Volume Discount App : Free | Custom Pricing Wholesale App : Free

View solution in original post

Replies 6 (6)

oscprofessional
Shopify Partner
16116 2409 3125

This is an accepted solution.

Hello @oncewilddesigns,

PLease edit

oscprofessional_0-1594654256603.png

Please replace 

{%- assign grid_item_width = 'medium-up--one-half' -%}

 

with

{%- assign grid_item_width = 'small--one-half medium-up--one-quarter' -%}
Get pass your Store Core Web Vital Free Speed Optimization Audit, Chat on WhatsApp | Skype : oscprofessionals-87 | Email: pallavi@oscprofessionals.com | Hire us | Guaranteed Site Speed Optimization | Website Free Audit | Shopify Theme Customization | Build Shopify Private App | Shopify SEO | Digital Marketing | Oscp Upsell & Cross sell App : Free | Oscp Sales & Volume Discount App : Free | Custom Pricing Wholesale App : Free
oncewilddesigns
Tourist
7 0 2

This worked - thank you so much!!

mikah
Tourist
4 0 2

Hi!

I'm new to this. This approach worked for me more or less. My goal is to make 5 filled columns smaller. So I changed 

 

{% elsif section.blocks.size == 5 %}
      {%- assign column_width = 'one-fifth columns medium-down--one-half' -%} 

 

to 

 

{% elsif section.blocks.size == 5 %}
      {%- assign column_width = 'one-seventh columns medium-down--one-half' -%} 

 

The "seventh" made each column smaller, but now I have to somehow centre align it. Any ideas on how to do that?

logancps
Tourist
15 0 1

Thank you for your nice solution. I was helped by this. 

KetanKumar
Shopify Partner
37133 3648 12061

Hello, @oncewilddesigns 

Welcome to the Shopify community!
and Thanks for your question.

1. Go to Online Store->Theme->Edit code
2. Asset->/theme.scss.liquid->paste below code at the bottom of the file.

#shopify-section-feature-columns .page-width {
    max-width: 800px;
}

 

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing

jamesscott
Tourist
26 0 1

Huge code. I am not friendly in this code.