Page 1 of 1

[SOLVED] SiteMapMadeSimple mod

Posted: Sun Aug 08, 2010 9:08 am
by spike
Can anyone tell me how to mod SiteMapMadeSimple to write non-hierarchial URL's to the xml file ?
gruss - spike

Re: SiteMapMadeSimple mod

Posted: Mon Aug 09, 2010 8:10 am
by Andiministrator
Sitemap made simple uses a template for generating the XML.

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;
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 ...

Re: SiteMapMadeSimple mod

Posted: Mon Aug 09, 2010 9:54 am
by spike
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

Re: [SOLVED] SiteMapMadeSimple mod

Posted: Mon Aug 09, 2010 3:26 pm
by JasperE
Thanks Andiministrator!

Re: [SOLVED] SiteMapMadeSimple mod

Posted: Fri Aug 13, 2010 12:06 pm
by M@rtijn
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?

Re: [SOLVED] SiteMapMadeSimple mod

Posted: Fri Aug 13, 2010 5:18 pm
by wiseguy
ringportal 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.
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 Sitemap

Re: [SOLVED] SiteMapMadeSimple mod

Posted: Fri Aug 13, 2010 6:07 pm
by M@rtijn
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!