Sitemap page

While Neto by Maropost automatically generates sitemaps and submits them to Google, some customers like to also have a sitemap page which is visible to customers.

The code snippet below is an example of how you could make a sitemap page. You may need to tweak it to ensure it suits your content structure.


Preparation Checklist

Before you start this tweak, it's a good idea to run through our preparation checklist below:

  • Read through the Getting Started Guide to get a better sense of how the Control Panel, Database and Front End store interact.
  • Learn our recommended Simple Workflow. This makes the implementation process as easy as possible.
  • Create a new Staging Theme for this tweak. This allows you to preview any changes before they are visible to live customers.
  • The code snippet in this tweak doc uses Bootstrap 4, you may need to alter this code depending on what version of Bootstrap your theme is using. You can find out what version your theme is using here.

Coding Instructions

Step 1: Create a new template

Navigate to the cms folder /httpdocs/assets/themes/[THEME-NAME]/templates/cms and create a new file named sitemap.template.html.

Step 2: Add the code to the template

Paste the following code into the newly created sitemap template:

<div class="col-12">
    <h1 class="display-4">[%url_info name:'page_heading' default:'[@content_name@]'/%]</h1>
    <ul>
        [%content_menu content_type:'category' limit:''%]
            [%param header%]
                <li>Categories
                    <ul>
            [%/param%]
            [%param *level_1%]
                        <li><a href="[@url@]">[@name@]</a>
                        [%if [@next_level@]%]
                            <ul>[@next_level@]</ul>
                        [%/if%]
            [%/param%]
            [%param *level_2%]
                        <li><a href="[@url@]">[@name@]</a>
                        [%if [@next_level@]%]
                            <ul>[@next_level@]</ul>
                        [%/if%]
            [%/param%]
            [%param *level_3%]
                        <li><a href="[@url@]">[@name@]</a>
                        [%if [@next_level@]%]
                            <ul>[@next_level@]</ul>
                        [%/if%]
            [%/param%]
            [%param *level_4%]
                        <li><a href="[@url@]">[@name@]</a>
                        [%if [@next_level@]%]
                            <ul>[@next_level@]</ul>
                        [%/if%]
            [%/param%]
            [%param *level_5%]
                        <li><a href="[@url@]">[@name@]</a>
                        [%if [@next_level@]%]
                            <ul>[@next_level@]</ul>
                        [%/if%]
            [%/param%]
            [%param *level_6%]
                        <li><a href="[@url@]">[@name@]</a>
                        [%if [@next_level@]%]
                            <ul>[@next_level@]</ul>
                        [%/if%]
            [%/param%]
            [%param *level_7%]
                        <li><a href="[@url@]">[@name@]</a>
                        [%if [@next_level@]%]
                            <ul>[@next_level@]</ul>
                        [%/if%]
            [%/param%]
            [%param footer%]
                    </ul>
                </li>
            [%/param%]
        [%/content_menu%]

        [%content_menu type:'page' limit:''%]
            [%param header%]
                <li>Content Pages
                    <ul>
            [%/param%]
            [%param *level_1%]
                        <li><a href="[@url@]">[@name@]</a>
                        [%if [@next_level@]%]
                            <ul>[@next_level@]</ul>
                        [%/if%]
            [%/param%]
            [%param *level_2%]
                        <li><a href="[@url@]">[@name@]</a>
                        [%if [@next_level@]%]
                            <ul>[@next_level@]</ul>
                        [%/if%]
            [%/param%]
            [%param *level_3%]
                        <li><a href="[@url@]">[@name@]</a>
                        [%if [@next_level@]%]
                            <ul>[@next_level@]</ul>
                        [%/if%]
            [%/param%]
            [%param *level_4%]
                        <li><a href="[@url@]">[@name@]</a>
                        [%if [@next_level@]%]
                            <ul>[@next_level@]</ul>
                        [%/if%]
            [%/param%]
            [%param *level_5%]
                        <li><a href="[@url@]">[@name@]</a>
                        [%if [@next_level@]%]
                            <ul>[@next_level@]</ul>
                        [%/if%]
            [%/param%]
            [%param *level_6%]
                        <li><a href="[@url@]">[@name@]</a>
                        [%if [@next_level@]%]
                            <ul>[@next_level@]</ul>
                        [%/if%]
            [%/param%]
            [%param *level_7%]
                        <li><a href="[@url@]">[@name@]</a>
                        [%if [@next_level@]%]
                            <ul>[@next_level@]</ul>
                        [%/if%]
            [%/param%]
            [%param footer%]
                    </ul>
                </li>
            [%/param%]
        [%/content_menu%]

        [%content_menu type:'blog' limit:''%]
            [%param *level_1%]
                <li><a href="[@url@]">[@name@]</a>
                [%if [@next_level@]%]
                    <ul>[@next_level@]</ul>
                [%/if%]
            [%/param%]
            [%param *level_2%]
                        <li><a href="[@url@]">[@name@]</a>
                        [%if [@next_level@]%]
                            <ul>[@next_level@]</ul>
                        [%/if%]
            [%/param%]
            [%param *level_3%]
                        <li><a href="[@url@]">[@name@]</a>
                        [%if [@next_level@]%]
                            <ul>[@next_level@]</ul>
                        [%/if%]
            [%/param%]
            [%param *level_4%]
                        <li><a href="[@url@]">[@name@]</a>
                        [%if [@next_level@]%]
                            <ul>[@next_level@]</ul>
                        [%/if%]
            [%/param%]
            [%param *level_5%]
                        <li><a href="[@url@]">[@name@]</a>
                        [%if [@next_level@]%]
                            <ul>[@next_level@]</ul>
                        [%/if%]
            [%/param%]
            [%param *level_6%]
                        <li><a href="[@url@]">[@name@]</a>
                        [%if [@next_level@]%]
                            <ul>[@next_level@]</ul>
                        [%/if%]
            [%/param%]
            [%param *level_7%]
                        <li><a href="[@url@]">[@name@]</a>
                        [%if [@next_level@]%]
                            <ul>[@next_level@]</ul>
                        [%/if%]
            [%/param%]
        [%/content_menu%]
    </ul>

Step 3: Create an information page

Create an information page, and set the "Body Template" to sitemap.

*Note: the page URL must not contain the text "sitemap", otherwise it will just display a 404 page.

Was this article useful?

Be notified when this page is updated. Optional.