STYLING DYNAMIC TABS - dawn

Topic summary

A user working with Shopify’s Dawn theme needed help applying bold text formatting across all dynamic product tabs, not just a specific ‘CRITIC’ tab.

Original Issue:

  • Code used conditional logic ({% if block.settings.heading contains 'CRITIC' %}) to apply formatting only to one tab
  • User wanted the same formatting applied universally to all tabs

Attempted Solution:

  • Another user suggested removing the conditional statement entirely
  • This approach resulted in a Liquid syntax error: “‘endif’ is not a valid delimiter for case tags”

Resolution:

  • The original poster solved the issue using ChatGPT
  • Final working code removes the conditional logic and uses **{{ member }}** for bold formatting instead of HTML <b> tags
  • The solution successfully applies the pipe-delimited content formatting to all dynamic tabs
Summarized with AI on October 30. AI used: claude-sonnet-4-5-20250929.

Hi!

I’ve used below code to make sure that I can bold text in one of my dynamic tabs however I want it to apply to all tabs, not just the ‘critics review’ tab.

I’ve placed it in the main product liquid section and replaced the block.settings.content for the code below. (Using dawn theme)

What could I change in the top line to make it apply to all tabs?

Thanks!

{% if block.settings.heading contains 'CRITIC' %}
              {% assign beatles = block.settings.content | split: "|" %}
               {% for member in beatles %}
                  {% assign value = forloop.index | modulo:2 %}
                  {% if value != 0  %}
                  {{ member }}<b>
                    {% else %}
                  {{ member }}
                   </b> {% endif %}
                {% endfor %}
              {% else %}
              {{ block.settings.content }}
                {% endif %}

website (product te motu 2019)

passw: waiheke

Hi @INFRA ,

I am from Mageplaza - Shopify solution expert.

Your current code applies bold formatting only when the tab’s heading contains “CRITIC”. To make it apply to all tabs, simply remove the {% if block.settings.heading contains ‘CRITIC’ %} condition so that it runs for every tab. Here’s the updated code:

{% assign beatles = block.settings.content | split: "|" %}
{% for member in beatles %}
    {% assign value = forloop.index | modulo:2 %}
    {% if value != 0 %}
        {{ member }}<b>
    {% else %}
        {{ member }}</b>
    {% endif %}
{% endfor %}

Please let me know if it works as expected!

Best regards!

1 Like

hi, thanks for your reply!

I tried that before but I got below error:

  • Liquid syntax error (line 236): ‘endif’ is not a valid delimiter for case tags. use endcase

anything else I could try? Thanks!

this is the entire code if that helps:


                    {% if block.settings.heading contains 'COMPOSITION'  %}
                    
              {% assign beatles = block.settings.content | split: "|" %}
               {% for member in beatles %}
                  {% assign value = forloop.index | modulo:2 %}
                  {% if value != 0  %}
                  {{ member }}<b>
                    {% else %}
                  {{ member }}
                   </b> {% endif %}
                {% endfor %}
              {% else %}
              {{ block.settings.content }}
                {% endif %}
                      {{ block.settings.page.content }}
                    

                  
                

anyone looking for this, I figure it out with Chatgpt:


  {% assign beatles = block.settings.content | split: "|" %}
  {% for member in beatles %}
    {% assign value = forloop.index | modulo: 2 %}
    {% if value != 0 %}
      {{ member }}
    {% else %}
      **{{ member }}**
    {% endif %}
  {% endfor %}

  {{ block.settings.page.content }}