How to assign numeric letter to section #?

hello I want to assign all vendors that start with a number or symbol to the section #?:

{% for item in search.results %}

{{ item.content | highlight: search.terms }}
{% endfor %}

{% assign letters = "" %} {% for vendor in shop.vendors %} {% capture vendorLetter %} {{ vendor | slice: 0, 1 }} {% endcapture %} {% unless letters contains vendorLetter %} {% assign letters = letters | append: vendorLetter %} {% endunless %} {% endfor %} {% assign letters = letters | split: '' %} {% for letter in letters %} {{ letter }} {% endfor %}

{% assign totalCols = 2 %}
{% assign totalItems = shop.vendors | size %}
{% assign remainingItems = totalItems %}
{% assign itemsPerColumn = remainingItems | divided_by: totalCols | ceil %}

{% assign current = "" %} {% assign vendorsCount = 0 %} {% assign columnItems = itemsPerColumn %}

{% for vendor in shop.vendors %}
{% capture vendorLetter %}
{{ vendor | slice: 0, 1 }}
{% endcapture %}

{% if vendorLetter != current %}
{% if vendorsCount > 0 %}

{% endif %}

{% if columnItems == 0 %}
{% if forloop.index < totalCols %}

{% endif %} {% assign columnItems = itemsPerColumn %} {% endif %}
{{ vendorLetter }}
{% assign vendorsCount = 0 %} {% endif %}

{% assign current = vendorLetter %}
{% assign vendorsCount = vendorsCount | plus: 1 %}
{% assign remainingItems = remainingItems | minus: 1 %}
{% assign columnItems = columnItems | minus: 1 %}

{% if remainingItems == 0 %}
{% break %}
{% endif %}
{% endfor %}

{% if vendorsCount > 0 %}

{% endif %}
Now display: [https://prnt.sc/Wi7uCz4RpROH](https://prnt.sc/Wi7uCz4RpROH) I want display like this: [https://prnt.sc/ZztpVjzhoqj3](https://prnt.sc/ZztpVjzhoqj3)

Hey @kestas97

To assign all vendors that start with a number or symbol to the section #?, you can modify the code as follows:


In this modified code, the lines with **{% assign letterCode = letter | downcase | strip %}** and the subsequent **if** conditions check if the **letterCode** is "**#**" or "**?**". If it matches, it creates the corresponding link. Otherwise, it creates a regular link based on the letter.

Note: Make sure to replace the existing code in the **collection.liquid** file with this updated code.

If I managed to help you then, don't forget to **Like it** and **Mark it as Solution!**

Best Regards,
Moeed

The same :grinning_face_with_smiling_eyes: :