• Resolved goodmansaul

    (@goodmansaul)



    I have a table created with ACF Views (ACF + WP taxonomy) and I would like to separate the values ??by a comma when there is more than one value. Example in the image.

    {% if tipo_de_solo.value %}
    <tr>
    <th>{{ tipo_de_solo.label }}</th>
    <td>
    {% for choice_item in tipo_de_solo.value %}					      {{ choice_item.title }}
    {% endfor %}
    </td>
    </tr>
    {% endif %}
    
    
    {% if tipos_de_planta.value %}
    <tr>
    			
    <th>	
    {{ tipos_de_planta.label }}
    </th>
    <td>
    {% for term_item in tipos_de_planta.value %}
    <a target="{{ term_item.target }}" class="acf-view__tipos-de-planta-link" href="{{ term_item.value }}"> {{ term_item.linkLabel|default(term_item.title) }}
    </a>
    {% endfor %}
    </td>
    </tr>	
    {% endif %}
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter goodmansaul

    (@goodmansaul)

    Solved.

    .acf-view__tipos-de-planta-link:not(:last-child)::after {
        content: ",";
        padding-right: 3px;
    }
    
    .acf-view__tipo-de-solo-choice:not(:last-child)::after {
        content: ",";
        padding-right: 3px;
    }
    
    .acf-view__tipo-de-solo-choice {
        display:inline-flex;
    }
    • This reply was modified 11 months, 4 weeks ago by goodmansaul.
    Plugin Author WPLake

    (@wplakeorg)

    Hi @goodmansaul

    You could also use the ‘delimiter’ field in the “Field Settings” when assigning the taxonomy field.
    See below for more details.

    Thread Starter goodmansaul

    (@goodmansaul)

    Hi WPLakei, thanks for the suggestion. However, I was unable to see the example of your message. Could you send it again?

    Thread Starter goodmansaul

    (@goodmansaul)

    I get it. But only with the taxonomy terms (WP) . With the ACF checkbox the “value delimiter” is not available. Anyway thank you!!! It’s another possibility…

    For anyone interested, see the image below.

    Plugin Author WPLake

    (@wplakeorg)

    Hi @goodmansaul

    Yes, the delimiter field under field settings is available for field types select, post object, taxonomy, page link, relationship and user.

    For other cases the CSS you’ve shared should work well.

    Sorry about the image being missing, it seems it was removed somehow.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to add a comma in the list with multiple values?’ is closed to new replies.