Page 1 of 3

News articles in XML sitemap (Sitemap Made Simple)

Posted: Wed Oct 01, 2008 2:01 pm
by Chris
Hi Everybody,

I use SitemapMadeSimple to generate a Google compatible XML sitemap, but it doesn't include my news pages. Does anyone know how I can do this?

Thanks in Advance!

Chris

Re: News articles in XML sitemap (Sitemap Made Simple)

Posted: Sun Nov 02, 2008 5:55 am
by JeremyBASS
A gift :D

Code: Select all

{* sitemap template *}
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84
	http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">

{foreach from=$output item='page'}
<url>
  <loc>{$page->url}</loc>
  <lastmod>{$page->date|date_format:"%Y-%m-%d"}</lastmod>
  <priority>{$page->priority}</priority>
  <changefreq>{$page->frequency}</changefreq>

</url>
{/foreach}
{capture assign='junk'}{news number='1000'}{/capture}
{foreach from=$items item=entry}
<url>
  <loc>{$entry->moreurl}</loc>

{if $entry->formatpostdate}
  <lastmod>{$entry->formatpostdate|date_format:"%Y-%m-%d"}</lastmod>
{/if}
<priority>{$page->priority}</priority>
  <changefreq>{$page->frequency}</changefreq>
</url>
{/foreach}
</urlset>
would work with blogs to...
jeremyBass

Re: News articles in XML sitemap (Sitemap Made Simple)

Posted: Thu Nov 06, 2008 6:15 pm
by JeremyBASS
Correction on this... Blogs doesn't seem to work fully here ... the landing page in the url seems to be missing... I think that is the issue...

I'm sure someone like Calguy would know why but.. fix that and the we'd be back to what I said beofre...

Have a great one...
jeremyBass

fixed... look to this post for the bolg fix and the news fix..

http://forum.cmsmadesimple.org/index.ph ... #msg133319

Re: News articles in XML sitemap (Sitemap Made Simple)

Posted: Wed Nov 26, 2008 9:15 am
by Romke
Google accepts not only it's own xml sitemap format but also RSS . So you can add both the xml sitemap from the Sitemap Made Simple module and the RSS feed of your news pages.

Re: News articles in XML sitemap (Sitemap Made Simple)

Posted: Wed Nov 26, 2008 4:02 pm
by JeremyBASS
I also fixed the news and blogs up alittle better look to the tips and tricks area... here is the post it's self witht he news fix...

http://forum.cmsmadesimple.org/index.ph ... #msg133319

Re: News articles in XML sitemap (Sitemap Made Simple)

Posted: Wed Oct 07, 2009 8:41 pm
by katea
JeremyBASS wrote: A gift :D

Code: Select all

{* sitemap template *}
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84
	http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">

{foreach from=$output item='page'}
<url>
  <loc>{$page->url}</loc>
  <lastmod>{$page->date|date_format:"%Y-%m-%d"}</lastmod>
  <priority>{$page->priority}</priority>
  <changefreq>{$page->frequency}</changefreq>

</url>
{/foreach}
{capture assign='junk'}{news number='1000'}{/capture}
{foreach from=$items item=entry}
<url>
  <loc>{$entry->moreurl}</loc>

{if $entry->formatpostdate}
  <lastmod>{$entry->formatpostdate|date_format:"%Y-%m-%d"}</lastmod>
{/if}
<priority>{$page->priority}</priority>
  <changefreq>{$page->frequency}</changefreq>
</url>
{/foreach}
</urlset>
would work with blogs to...
jeremyBass

Hi Jeremy, This works great in News, but where do I put this in Blogs?

Thanks :)

Re: News articles in XML sitemap (Sitemap Made Simple)

Posted: Wed Oct 07, 2009 10:04 pm
by JeremyBASS
Well you'd want to capture the blog output... so {capture assign='junk'}{CGBlog pagelimit="100000" }{/capture}  or what have you.. then it's just the parts of the defualt template.

Code: Select all

{capture assign='junk'}{CGBlog pagelimit="100000" }{/capture}
{foreach from=$items item=entry}
<url>
  <loc>{$entry->detail_url}</loc>

{if $entry->formatpostdate}
  <lastmod>{$entry->postdate|date_format:"%Y-%m-%d"}</lastmod>
{/if}
<priority>{$page->priority}</priority>
  <changefreq>{$page->frequency}</changefreq>
</url>
{/foreach}




So this can be done for more than just blogs or news,... got products? Have a User directory via FEU or Company directories?  With this route you can take hold and make an almost permanent link for every nooke and crany of a CMSMS site..

Re: News articles in XML sitemap (Sitemap Made Simple)

Posted: Wed Oct 07, 2009 10:39 pm
by katea
Hi Jeremy,

Thanks for the swift reply ...

This is mmy template, but the sitemap only picks up just one of the entries

Code: Select all

{* sitemap template *}
<?xml version="1.0" encoding="UTF-8"?>
<urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<!-- created with Free Online Sitemap Generator www.xml-sitemaps.com -->

{foreach from=$output item='page'}
<url>
  <loc>{$page->url}</loc>
  <changefreq>{$page->frequency}</changefreq>
</url>
{/foreach}

</urlset>

{capture assign='junk'}{CGBlog pagelimit="100000" }{/capture}
{foreach from=$items item=entry}
<url>
  <loc>{$entry->detail_url}</loc>

{if $entry->formatpostdate}
  <lastmod>{$entry->postdate|date_format:"%Y-%m-%d"}</lastmod>
{/if}
<priority>{$page->priority}</priority>
  <changefreq>{$page->frequency}</changefreq>
</url>
{/foreach}
Help!!! ;o)

p.s It was my first blog entry thast it picked up ... Not sure if that helps?

Re: News articles in XML sitemap (Sitemap Made Simple)

Posted: Wed Oct 07, 2009 10:50 pm
by JeremyBASS
oh.. try

{CGBlog}

Re: News articles in XML sitemap (Sitemap Made Simple)

Posted: Wed Oct 07, 2009 10:53 pm
by katea
Took out the post count and just put  {CGBlog} and still the same ...

I cleared the cache and everything, but still just the first post

Oh, and the URL comes up as

http://www.mysite.com/cgblog/1//MyFirstEntry

Instead of

http://www.mysite.com/Blog/1/60/MyFirstEntry

So Blog is being changed to cgblog and I'm getting a double // after 1

Re: News articles in XML sitemap (Sitemap Made Simple)

Posted: Wed Oct 07, 2009 11:31 pm
by JeremyBASS
welll.. look to the blog.... look to the Default summary page that should fix it... for the //

Re: News articles in XML sitemap (Sitemap Made Simple)

Posted: Wed Oct 07, 2009 11:41 pm
by katea
JeremyBASS wrote: welll.. look to the blog.... look to the Default summary page that should fix it... for the //
Sorry, I'm lost... I should look at changing the blog template?

Right now it's working good with the url's,, it's just the sitemap isn't picking up the entries... I don't really want to be messing around with the blog unless I can get it close to working,m getting all the URL's etc...

I know I'm a pain, but I really want this to work to save me from having to manually update my sitemap every time I post a blog entry.

I thank you for your patience Jeremy :)

Re: News articles in XML sitemap (Sitemap Made Simple)

Posted: Thu Oct 08, 2009 1:24 am
by JeremyBASS
Sorry that was vage there... got to Content » Calguys Blog Module  and in the options, and set the Default summary page ... that should fix it...

Re: News articles in XML sitemap (Sitemap Made Simple)

Posted: Thu Oct 08, 2009 10:34 am
by katea
JeremyBASS wrote: Sorry that was vage there... got to Content » Calguys Blog Module  and in the options, and set the Default summary page ... that should fix it...
Hi Jeremy,

OK, I did that, but I could only change the cgblog to blog, which is a great start obviously ....

However, in the sitemap, I sill only have the first entry and I still have the /1//entry instead of the 1/60/entry

I've played around with the code quite a bit, but getting this to work seems impossible.

Strange though as it works great in News!!!

Re: News articles in XML sitemap (Sitemap Made Simple)

Posted: Thu Oct 08, 2009 2:38 pm
by JeremyBASS
well this worked for me...

Code: Select all

{capture assign='junk'}{Blogs numentries="10000"}{/capture}
{foreach from=$items item=entry}
{assign var=utmpBLOGS value=$entry->entryurl|replace:'//':'/51/'|replace:'http:/51':'http:/'}
<url>
  <loc>{$utmpBLOGS}</loc>
  <lastmod>{$entry->time|date_format:"%Y-%m-%d"}</lastmod>
<priority>{$page->priority}</priority>
  <changefreq>{$page->frequency}</changefreq>
</url>
{/foreach}


just replace 51 with the page you want it to land on...