Adding HTML Sitemap to Footer of Website?

Highlighted
Tourist
5 0 0

It's a great solution my friend, and it works for me .... almost!

Actually, I can see only a part of the "all products" say the first 40's - and there are 300. 

Do you have any idea why the others don't appear?

You talked about 2 columns and I m not so good in codes. May you explain me better how to do it?

 

Thank you very much!

0 Likes
New Member
2 0 0

Hi all,

 

I had the same problem, and i've found a guide here: https://answers.squarespace.com/questions/21067/generate-html-sitemap.html

 

You can follow this method to get all of your links properly extracted, but you do need to organize and style it afterwards.

0 Likes
Highlighted
Shopify Partner
718 106 270

Hi - it's because Shopify limits 'for loops' to return a max of 50 results. You can get around this by adding a pagination limit. Here's the section of amended code which will return up to 1000 products:

 

{% paginate collections.all.products by 1000 %}
  {% for product in collections.all.products %}
  	<li>
    <a href="{{ product.url }}">{{ product.title }}</a>
 	 </li>
  {% endfor %}
{% endpaginate %}

You just change the number in {% paginate collections.all.products by 1000 %} to whatever the max number of products you have e.g. {% paginate collections.all.products by 500%} will return up to 500 products.

 

Here's the full code:

<div class="row">
<div class="col-md-6">
  <h2>Collections</h2>
       <ul>
  {% for c in collections %}
  <li>
    <a href="{{ c.url }}">{{ c.title }}</a>
  </li>
  {% endfor %}
</ul> 
        </div>
          <div class="col-md-6">
            <h2>Products</h2>
            <ul>
              
{% paginate collections.all.products by 1000 %}
  {% for product in collections.all.products %}
  	<li>
    <a href="{{ product.url }}">{{ product.title }}</a>
 	 </li>
  {% endfor %}
{% endpaginate %}

            </ul> 
          </div>
    </div>
      </div>
    </div>
  </div>
</div>
If helpful then please Like and Accept Solution
3 Likes
Highlighted

Thanks!  Exactly what I was looking for.

 

How can I give it some format on the page though?

WaterBottleShop.Online
https://waterbottleshop.online
0 Likes
Highlighted
New Member
2 0 0

@Jonasskalbo wrote:

Hi all,

 

I had the same problem, and i've found a guide here: https://answers.squarespace.com/questions/21067/generate-html-sitemap.html

 

You can follow this method to get all of your links properly extracted, but you do need to organize and style it afterwards.


Found out that this is not optimal, but it's the best i've got so far.

Used it on Snippet SEO and WEIZ but you'll need to update it every now and then.

0 Likes
Highlighted
Tourist
3 0 0

Thank you, this works great. What is the best way to sort the products and collections by title for example? I have tried a few things but no luck. Any suggestions? Thanks.

0 Likes
Highlighted
New Member
2 0 3

This is great @JonWright . Thanks. Do you also have code for the Content Pages to be added or should we just add those manually?

1 Like
Highlighted
New Member
2 0 3

Also @JonWright , do you have a code to add for blog posts? Then it will be a full html sitemap 

2 Likes
Highlighted
New Member
1 0 0

Yes please how to add plog post in html sitemap

0 Likes
Highlighted
Tourist
31 0 2

How to add more  navigation lists to the page? Like about us or blogs?

0 Likes