diff --git a/plugins/box/sitemap/views/frontend/index.view.php b/plugins/box/sitemap/views/frontend/index.view.php
index 5cf4c81..5c732ca 100644
--- a/plugins/box/sitemap/views/frontend/index.view.php
+++ b/plugins/box/sitemap/views/frontend/index.view.php
@@ -2,28 +2,46 @@
0) {
+ $children_started = false;
+ $first = true;
foreach ($pages_list as $page) {
+
+ if (trim($page['parent']) === '' && $children_started) {
+ $children_started = false;
+ $sitemap_html .= "
\n";
+ } elseif(!$first && (trim($page['parent']) !== '' && $children_started || trim($page['parent']) === '')) {
+ $sitemap_html .= "\n";
+ }
+
if (trim($page['parent']) !== '') $parent = $page['parent'].'/'; else $parent = '';
- if (trim($page['parent']) !== '') { echo ''."\n"; }
+ if (trim($page['parent']) !== '' && !$children_started) {
+ $children_started = true;
+ $sitemap_html .= "\n";
+ }
+ $sitemap_html .= '- '.$page['title'].'';
+ $first = false;
+ }
+ if (trim($page['parent']) === '' && $children_started) {
+ $sitemap_html .= "
\n";
+ } else {
+ $sitemap_html .= "\n";
}
- if (count($components) == 0) { echo ''."\n"; }
}
// Display components
if (count($components) > 0) {
- if (count($pages_list) == 0) { echo ''."\n"; }
}
+ echo $sitemap_html;
+
?>