How to submit News using Sitemaps

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
eferrini
Forum Members
Forum Members
Posts: 17
Joined: Tue May 04, 2010 6:21 pm

Re: How to submit News using Sitemaps

Post by eferrini »

Thanks for taking the time to share this.  I found this useful.

Tony
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am
Location: The Netherlands

Re: How to submit News using Sitemaps

Post by Gregor »

Thanks for posting.

I use CGBlog, therefore made a minor modification:

Create template CGBlogSiteMap

Code: Select all

{foreach from=$items item=entry}
<url>
  <loc>{$entry->detail_url}</loc>
  <lastmod>{$entry->postdate|date_format:"%Y-%m-%d"}</lastmod>
  <changefreq>never</changefreq>
</url>
{/foreach}
In Sitemapmadesimple:

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}

{CGBlog showall="0" summarytemplate="CGBlogSiteMap"}

</urlset>
I noticed in Sitemap MS that, once edited the Sample-template, after submitting the changes, the template does not show up in the template overview (2nd tab). Creating a new template called Sample, gives an error saying that the template already exists although it does not show up.

Any ideas?

Gregor
blackhawk
Power Poster
Power Poster
Posts: 280
Joined: Mon Oct 20, 2008 6:07 pm

Re: How to submit News using Sitemaps

Post by blackhawk »

Thank you. I'm using cmsms 1.10.2 and the NewsSiteMap Template that I'm using for Google Webmaster Tools, looks like this...

Code: Select all

{foreach from=$items item=entry}
<url>
<loc>{$entry->moreurl}</loc>
{if $entry->postdate}<lastmod>{$entry->postdate|date_format:"%Y-%m-%d"}</lastmod>{/if}
<priority>1.0</priority>
<changefreq>always</changefreq>
</url>
{/foreach}
Works for me.

The only catch I have noticed when updating your sitemap is that for every change you make in your news template, you have to go back to the info tab under sitemap made simple, and re-save it. Then go to your browser window to see your updated sitemap.xml file.

Hope that helps
User avatar
manuel
Power Poster
Power Poster
Posts: 353
Joined: Fri Nov 30, 2007 9:15 am

Re: How to submit News using Sitemaps

Post by manuel »

Dear Blackhawk,

Please take a look at this article:
http://www.i-do-this.com/blog/57/Update ... with-a-UDT

Greetings,
Manuel
blackhawk
Power Poster
Power Poster
Posts: 280
Joined: Mon Oct 20, 2008 6:07 pm

Re: How to submit News using Sitemaps

Post by blackhawk »

That helps! Thank you again!
Post Reply

Return to “Tips and Tricks”