How can I make certain words bold in all meta fields descriptions?

Dear all

I am creating meta fields and want certain words to be bold in the meta fields descriptions. I have inserted the following code:

{% if block.settings.heading contains 'Ingredients' %}
              {% 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 %}

It works so far, but only for the meta field “Ingredients” but not for the other meta fields. Does anyone have an idea how I can set this up for all metafields and not only for one metafield (“Ingredients”)?

Many thanks!

Hello @RenV

It’s GemPages support team and glad to support you today.

I would like to give you a solution to support you.

You can try again with the updated code below:

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

Hope my solution can work and support you!

Kind & Best regards!

GemPages Support Team.

Hi @GemPages

Thank you for your help. Unfortunately it doesn’t work, maybe my description was a bit misleading. I have several meta fields (e.x. Ingredients, storage, etc.) In this metafields I’d like to make some words bold, but not all of them. I want to mark the words I want to make bold with “|” e.x. “|wheat|”. The code I posted seems to work, but only for the Metafield “Ingredients” and not for all the other metafields like e.x. “storage”. Do you have an idea of a code, so that the solution with “|” works for all metafields and not only for the metafield “Ingredients”?

Many thanks!

Best regards