Topic: A small fix to the Sitemap of Monstra

Sitemap works weird and we know it, so i try to find a solution how to fix it...
I found one by removing all Components show from sitemap front view index file, it stop showing all plugins like users/ some backend plugins which does not even have a front view but still been showed in sitemap =/

so we have to go to plugins/box/sitemap/views/frontend/index.view.php
Delete all of the code in there and past this one instead:

<ul>
<?php
    $sitemap_html = '';
    // Display pages
    if (count($pages_list) > 0) {
        $children_started = false;
        $first = true;
        foreach ($pages_list as $page) {
            if (trim($page['parent']) === '' && $children_started) { 
                $children_started = false;
                $sitemap_html .= "</li></ul></li>\n";
            } elseif(!$first && (trim($page['parent']) !== '' && $children_started || trim($page['parent']) === '')) {
                $sitemap_html .= "</li>\n";
            }
            if (trim($page['parent']) !== '') $parent = $page['parent'].'/'; else $parent = '';
            if (trim($page['parent']) !== '' && !$children_started) { 
                $children_started = true;
                $sitemap_html .= "<ul>\n"; 
            }
            $sitemap_html .= '<li><a href="'.Option::get('siteurl').'/'.$parent.$page['slug'].'">'.$page['title'].'</a>';
            $first = false;
        }
        if (trim($page['parent']) === '' && $children_started) { 
            $sitemap_html .= "</li></ul></li>\n"; 
        } else {
            $sitemap_html .= "</li>\n";
        }
    }
    // Display components none!
    echo $sitemap_html;
?>
</ul>

or if u dont want to touch any box plugins default codes / style just copy this

box/sitemap/views/frontend/index.view.php

and place it in ur theme for example if we have theme name "mytheme" so at the end it will look like this

public/themes/mytheme/box/sitemap/views/frontend/index.view.php

Because monstra first checking if there is any changed in front view at ur theme location if not then it take it from folder plugins, so even if u update monstra later all of ur change still gonna work no matter what wink

(с) Roman Art
So far So good wink

RomanArt's Website