[SOLVED] SiteMapMadeSimple mod

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
spike
Forum Members
Forum Members
Posts: 153
Joined: Thu Sep 25, 2008 5:02 pm

[SOLVED] SiteMapMadeSimple mod

Post by spike »

Can anyone tell me how to mod SiteMapMadeSimple to write non-hierarchial URL's to the xml file ?
gruss - spike
Last edited by spike on Mon Aug 09, 2010 9:54 am, edited 1 time in total.
Andiministrator

Re: SiteMapMadeSimple mod

Post 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 ...
Last edited by Andiministrator on Mon Aug 09, 2010 11:35 am, edited 1 time in total.
spike
Forum Members
Forum Members
Posts: 153
Joined: Thu Sep 25, 2008 5:02 pm

Re: SiteMapMadeSimple mod

Post 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
JasperE
New Member
New Member
Posts: 8
Joined: Tue Nov 24, 2009 9:02 pm

Re: [SOLVED] SiteMapMadeSimple mod

Post by JasperE »

Thanks Andiministrator!
User avatar
M@rtijn
Power Poster
Power Poster
Posts: 706
Joined: Sat Nov 14, 2009 4:54 pm

Re: [SOLVED] SiteMapMadeSimple mod

Post 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?
Last edited by M@rtijn on Fri Aug 13, 2010 6:08 pm, edited 1 time in total.
Make your community a better place!
wiseguy
Forum Members
Forum Members
Posts: 16
Joined: Wed Oct 07, 2009 10:01 pm

Re: [SOLVED] SiteMapMadeSimple mod

Post 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
User avatar
M@rtijn
Power Poster
Power Poster
Posts: 706
Joined: Sat Nov 14, 2009 4:54 pm

Re: [SOLVED] SiteMapMadeSimple mod

Post 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!
Make your community a better place!
Post Reply

Return to “Modules/Add-Ons”