advanced sitemap

Talk about new features for CMSMS and modules.
Post Reply
User avatar
antiheld2000
Forum Members
Forum Members
Posts: 236
Joined: Thu Jan 31, 2008 9:23 am

advanced sitemap

Post by antiheld2000 »

Hi,

wouldn't it be nice, if there would be a optional parameter for the sitemap tag, which tells the tag to look after a meta description for the content. if there is a desciption: print it right below the title of the menupoint. i think this would be a benefit for many sitemaps. what do you think?

regards
anti
nhaack

Re: advanced sitemap

Post by nhaack »

Hi Antiheld2000,

you could try out the content_dump plug-in. Sorting by hierarchy will allow you to list the pages in the correct order and you can access specific content blocks (e.g. an additional block called description). However, you can not use it to access the meta-data at the moment.

Alternatively, I guess with the CGSimple module (I think that was its name), you could also achieve something like you want.

I think the hardest part is to parse the meta-data and check for a description and use that (I do not know if if the CGSimple can do that).

Since I am a lazy guy, I use a content-block called "meta-description" on my page-templates and use that field in the template in the head-area. That way, the meta description is stored as a content-prop and I could use it easier. Don't know if that would be a solution for you.

I think the sitemap as described would be a great feature. I might consider to implement it in a new version of the content_dump plug-in (meta-data parsing)... but it would take a little time...

Best
Nils
User avatar
antiheld2000
Forum Members
Forum Members
Posts: 236
Joined: Thu Jan 31, 2008 9:23 am

Re: advanced sitemap

Post by antiheld2000 »

thanks for your answer. i would like to see this as a optional feature in the future. i tried it myself with some code snippets from php.net, but it doesn't work properly. i don't know if this is the right forum and wether the interest for this is big enough but i post my tryings:

i'm getting the meta-data in pluginsfunction.sitemap.php right behind line number 179 with this code (works great):

Code: Select all

$html = my_htmlentities($onecontent->Metadata());
right behind that i try to figure out the essential data i want with this code:

Code: Select all

preg_match_all("|<meta[^>]+name=\"([^\"]*)\"[^>]+content=\"([^\"]*)\"[^>]+>|i",$html,$out,PREG_PATTERN_ORDER);

for ($i=0;$i < count($out[1]);$i++) {
	if (strtolower($out[1][$i]) == "description") $meta['description'] = $out[2][$i];
}
and parse it to the $menu variable to print it out:

Code: Select all

$menu .= '<br />' . my_htmlentities($onecontent->Metadata()) . '<br />';
but unfortunately it doesn't work right. i think the regular expression is'nt correctly working. does anybody see the fault?
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm

Re: advanced sitemap

Post by Russ »

Use {description}?
User avatar
antiheld2000
Forum Members
Forum Members
Posts: 236
Joined: Thu Jan 31, 2008 9:23 am

Re: advanced sitemap

Post by antiheld2000 »

Russ wrote: Use {description}?
in the sitemap plugin?
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm

Re: advanced sitemap

Post by Russ »

Apologies antiheld2000, I should have had a coffee and woken up before posting !
Post Reply

Return to “Feature ideas”