Page 1 of 1

SitemapMgr and Sitemap

Posted: Mon Sep 14, 2020 8:31 am
by iKsu
Hello!
How are you?

I'd like to know, have I problem with a Sitemap?

I'm not profi, I'm creating website by myself.

I need a sitemap that will display all text content pages (even if they are not in the menu).
1. My Cmsms is 2.2.14 - SitemapMgr 1.6.1
The site is multilingual (russian, ukrainian), root pages structure is:
- rus (section header) > subpages
- ukr (section header) > subpages
- error404 page

2. In the SitemapMgr module of the Site Admin menu in the tab "Pages" I wrote {Navigator template='cms_template:Sitemap Pages' show_all=1}

3. Then I created two different sitemap:
Sitemap-rus with Module tag {Navigator start_element='1.1' show_root_siblings='1'}
Sitemap-ukr with Module tag {Navigator start_element='2.1' show_root_siblings='1'}

4. Then I added in config.php file

$config['permissive_smarty'] = 1;
$config['root_url'] = 'https://www.astra-net.com.ua';

4. Then I created in Design Manager "Templates" the SitemapMgr::Sitemap Pages with code


<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

{function name=Nav_sitemap}
{foreach $data as $node}
{page_attr key=searchable page=$node->id assign=isSearchable}
{if $node->type=='content' && !empty($isSearchable)}
<url>
<loc>{$node->url}</loc>
<lastmod>{$node->modified|date_format:'%Y-%m-%d'}</lastmod>
<changefreq>{math now=$smarty.now modified=$node->modified equation='(now-modified)/86400' assign='days'}{if $days < 2}hourly{elseif $days < 14}daily{elseif $days < 61}weekly{elseif $days < 365}monthly{else}yearly{/if}</changefreq>
<priority>{$level=$node->hierarchy|substr_count:'.'}{if $node->url|substr:0:-1 == {root_url}}1{elseif $level == '0'}0.8{elseif $level == '1'}0.6{elseif $level == '2'}0.4{else}0.2{/if}</priority>
</url>
{/if}
{if isset($node->children)}{Nav_sitemap data=$node->children}{/if}
{/foreach}
{/function}

{if isset($nodes)}{Nav_sitemap data=$nodes}{/if}

</urlset>


5. I added in google console sitemap.xml. But Google says, the page is indexed, but it is not in the Sitemap file

6. If I check sitemap.xml, it is indicated:
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://www.astra-net.com.ua/assets/sitemaps/sitemap-pages.xml</loc>
</sitemap>
<sitemap>
<loc>https://www.astra-net.com.ua/assets/sitemaps/sitemap-sitemap-rus.xml</loc>
</sitemap>
<sitemap>
<loc>https://www.astra-net.com.ua/assets/sitemaps/sitemap-sitemap-ukr.xml</loc>
</sitemap>
</sitemapindex>



All content pages are searchable and enabled.

See attaching files, please.
4.jpg
5.jpg
6.jpg
Have I installed all the modules exactly? Should sitemap.xml display all pages of the site or I haven't any problems? Does sitemap.xml work correctly?

Where can I check it?

Thanks.

Re: SitemapMgr and Sitemap

Posted: Mon Sep 14, 2020 12:33 pm
by Rolf
Hi and thanks for the extensive explanation of your problem!
3. Then I created two different sitemap:
Sitemap-rus with Module tag {Navigator start_element='1.1' show_root_siblings='1'}
Sitemap-ukr with Module tag {Navigator start_element='2.1' show_root_siblings='1'}
In these page sitemaps you miss the template parameter:

Code: Select all

template='cms_template:Sitemap Pages'
Hope this helps,

Rolf

Re: SitemapMgr and Sitemap

Posted: Mon Sep 14, 2020 1:37 pm
by iKsu
Dear Rolf, thank you for your response.

1. Now the sitemap displays only those pages that are in the menu, but I need to add all the context pages to the sitemap. Please help me.

Maybe the problem is in the code, which I wrote in Design Manager "Templates" the SitemapMgr::Sitemap Pages?

2. The second problem is https://www.astra-net.com.ua/assets/sit ... -pages.xml - This page contains the following errors:
error on line 1 at column 1: Document is empty
Below is a rendering of the page up to the first error.

What should I do?

Thanks

Re: SitemapMgr and Sitemap

Posted: Mon Sep 14, 2020 4:39 pm
by Rolf
Sitemap-rus with Module tag
{Navigator template='cms_template:Sitemap Pages' start_element='1.1' show_root_siblings='1' show_all=1}

Sitemap-ukr with Module tag
{Navigator template='cms_template:Sitemap Pages' start_element='2.1' show_root_siblings='1' show_all=1}

If these two are your page sitemap you can delete the default "pages" sitemap.

Don't forget to reload your sitemap in the browser (CTRL F5) when you try to see the changes.

Also be sure you use the default module page sitemap
http://viewsvn.cmsmadesimple.org/filede ... _pages.tpl

Re: SitemapMgr and Sitemap

Posted: Mon Sep 14, 2020 6:19 pm
by Rolf
Ps. The content of the sitemap templates can be found in the CMSMS Design Manager module!

The Sitemap Pages should contain this code:
http://viewsvn.cmsmadesimple.org/filede ... _pages.tpl

Re: SitemapMgr and Sitemap

Posted: Tue Sep 15, 2020 4:45 am
by iKsu
Dear Rolf, thank you so much!
I have done it.