Page.list-collections page not formatted properly

I am currently designing a new theme called Flex (Fresh). In the process, I have been trying to build a page of collections. For example, I want the top nav to link to a page titled Jewelry that features a page of subcategories like Bracelets, Earrings, Necklaces, Keychains. I was able to edit the code of the page.list-collections.liquid template thanks to another Shopify community member. However, the code does not include any formatting. I am looking to edit the code so that the formatting matches the rest of the theme’s pages. Mainly the font style, font size, padding, and grid (4 images per page).

This is the desired formatting that the rest of the website has:

This is what the page.list-collections page currently looks like. It’s very sloppy looking:

Any help or resources would be greatly appreciated.

Here is the code:

{% comment %}
Collections are listed here.
{% endcomment %}

{% capture uses_minimal_framework %}{% include ‘product-loop’ %}{% endcapture %}

{% if uses_minimal_framework contains ‘Liquid error’ %}
{% assign uses_minimal_framework = false %}
{% assign grid_item_width = ‘large–one-quarter large-up–one-quarter medium–one-third medium-up–one-third small–one-half large–col-3 medium–col-4 small–col-6’ %}
{% else %}
{% assign uses_minimal_framework = true %}
{% assign grid_item_width = ‘span3’ %}
{% endif %}

{% assign image_size = ‘medium’ %}

{% if linklists[page.handle].links.size > 0 %}

{% assign number_of_links = 0 %}

{% for link in linklists[page.handle].links %}

{% if link.type == ‘collection_link’ %}

{% comment %}
If we have a collection link.
{% endcomment %}

{% assign collection = link.object %}
{% assign number_of_links = number_of_links | plus: 1 %}

Hello @LukeAdamsGlass

You can try the below code :

{% comment %}
Collections are listed here.
{% endcomment %}

{% capture uses_minimal_framework %}{% include 'product-loop' %}{% endcapture %}

{% if uses_minimal_framework contains 'Liquid error' %}
{% assign uses_minimal_framework = false %}
{% assign grid_item_width = 'large--one-quarter large-up--one-quarter medium--one-third medium-up--one-third small--one-half large--col-3 medium--col-4 small--col-6' %}
{% else %}
{% assign uses_minimal_framework = true %}
{% assign grid_item_width = 'span3' %}
{% endif %}

{% assign image_size = 'medium' %}

{% if linklists[page.handle].links.size > 0 %}

{% assign number_of_links = 0 %}

{% for link in linklists[page.handle].links %}
{% if link.type == 'collection_link' %}
{% comment %}
If we have a collection link.
{% endcomment %}
{% assign collection = link.object %}
{% assign number_of_links = number_of_links | plus: 1 %}

   

      
      {% comment %}
      Bring in the featured image of the first product in the collection if no collection
      image has been uploaded for it.
      {% endcomment %}
      {% if collection.image %}
      
      {% else %}
      {% assign product = collection.products.first %}
      
      {% endif %}
      
   

   

      {{ link.title }}
   

  

I hope the above is useful to you.
Best regards,
GemPages Support Team

Thank you! I just tried implementing this code but an error message pops up saying:

  • Liquid syntax error (line 51): ‘if’ tag was never closed

    Do you know what that means and how to resolve?

@GemPages see above. I just tried implementing this code but an error message pops up saying “Liquid syntax error (line 51): ‘if’ tag was never closed”

Do you know what that means and how to resolve?