Can anyone tell me how to mod SiteMapMadeSimple to write non-hierarchial URL's to the xml file ?
gruss - spike
[SOLVED] SiteMapMadeSimple mod
[SOLVED] SiteMapMadeSimple mod
Last edited by spike on Mon Aug 09, 2010 9:54 am, edited 1 time in total.
Re: SiteMapMadeSimple mod
Sitemap made simple uses a template for generating the XML.
1.) Create a new UDT called "flatURL" with the following content:
This is a quick-and-dirty UDT, I had no time to think about a regexp solution ...
2.) Modify the template of "Sitemap made simple":
Replace {$page->url} with {flatURL url=$page->url}
Thats all ...
1.) Create a new UDT called "flatURL" with the following content:
Code: Select all
$ex_flaturl = explode ('/', $params['url']);
$flaturl = '';
$flaturl_ending = '';
if (stripos($params['url'],'://')>0) $flaturl.= $ex_flaturl[0].'//'.$ex_flaturl[2].'/';
while (count($ex_flaturl)>0) {
if ($ex_flaturl[count($ex_flaturl)-1]!='') {
$flaturl.= $ex_flaturl[count($ex_flaturl)-1].$flaturl_ending;
break;
} else {
$flaturl_ending = '/';
array_pop($ex_flaturl);
}
}
echo $flaturl;
2.) Modify the template of "Sitemap made simple":
Replace {$page->url} with {flatURL url=$page->url}
Thats all ...
Last edited by Andiministrator on Mon Aug 09, 2010 11:35 am, edited 1 time in total.
Re: SiteMapMadeSimple mod
Andi - Well what can I say ? - a Q&D UDT maybe - but a superb solution to my problem - many thanks, I shall try and revenge when the opportunity arises. thanks again.
My site is now back to normal - flat as a pancake - and the URL's are also being indexed the way I want them.
gruss - spike
My site is now back to normal - flat as a pancake - and the URL's are also being indexed the way I want them.
gruss - spike
Re: [SOLVED] SiteMapMadeSimple mod
Thanks Andiministrator!
Re: [SOLVED] SiteMapMadeSimple mod
After upgrading to CMS 1.8.2 I found that the urls in the sitemap still use the 'ugly' way of showing parents. I don't want that.
I was looking into this mod to fix it, and it did, but for the link to the homepage something goes wrong.
The homepage is being shown as http://www.website.tld/www.website.tld/
Any solution to this?
I was looking into this mod to fix it, and it did, but for the link to the homepage something goes wrong.
The homepage is being shown as http://www.website.tld/www.website.tld/
Any solution to this?
Last edited by M@rtijn on Fri Aug 13, 2010 6:08 pm, edited 1 time in total.
Make your community a better place!
Re: [SOLVED] SiteMapMadeSimple mod
I did a fresh install of 1.8.2 and verified that SiteMapMadeSimple works fine with non-hierarchical urls. However, the module was not listed in the module manager, so I manually installed the .xml file. After changing the use_hierarchy setting, you need to generate a new sitemap: Extensions -> SiteMap Made Simple -> Info -> Save Sitemapringportal wrote: After upgrading to CMS 1.8.2 I found that the urls in the sitemap still use the 'ugly' way of showing parents. I don't want that.
Re: [SOLVED] SiteMapMadeSimple mod
Oops,
In the upgrade proces, the use_hierarchy was still set to true in the config.php. Changed it to false, now everything working perfect again!
In the upgrade proces, the use_hierarchy was still set to true in the config.php. Changed it to false, now everything working perfect again!
Make your community a better place!