Sitemap html

Sitemap html

j_adv21
Shopify Partner
14 0 1

Hi,

 

I wanted to create something like this : https://www.silkjewellery.com/sitemap
I saw a post here in the community that uses menu links to achieve this but I want to automatically create it (not listing it one by one). Is there an app that can do that? 

Reply 1 (1)

BlackCro
Shopify Partner
92 19 14

You could loop through the various objects to create something similar without the need for an external app.

 

<h1>Sitemap</h1>
<ul class="sitemap">

  <!-- Loop through Pages -->
  <li>Pages
    <ul>
      {% for page in pages %}
        <li><a href="{{ page.url }}">{{ page.title }}</a></li>
      {% endfor %}
    </ul>
  </li>

  <!-- Loop through Collections and Products -->
  <li>Collections
    <ul>
      {% for collection in collections %}
        <li><a href="{{ collection.url }}">{{ collection.title }}</a>
          <ul>
            {% for product in collection.products %}
              <li><a href="{{ product.url }}">{{ product.title }}</a></li>
            {% endfor %}
          </ul>
        </li>
      {% endfor %}
    </ul>
  </li>

  <!-- Loop through Blogs and Articles -->
  <li>Blogs
    <ul>
      {% for blog in blogs %}
        <li><a href="{{ blog.url }}">{{ blog.title }}</a>
          <ul>
            {% for article in blog.articles %}
              <li><a href="{{ article.url }}">{{ article.title }}</a></li>
            {% endfor %}
          </ul>
        </li>
      {% endfor %}
    </ul>
  </li>
</ul>

Hope this helps

Simon 

BlackCro.co.uk

CRO & Development Agency



Better Forms - Get a better contact form today!