Site I'm working on has some very unique settings for determining when/where a story appears, so using views to create the sitemap makes life easy. I'll be using this as a guide
http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=74288
If you do not have odd requirements, I recommend using this module instead.
http://drupal.org/project/googlenews
Comments
Comment #1
mikeytown2 commentedCreate a new view
Style: XML data document
Root element name: urlset
Top-level child element name: url
Using Views Custom Field create 2 PHP code fields.
loc
n:news
This site has a published date CCK field that tells at what time the node hits the front page view and is thus available to see. Also uses domain access source so no duplicate content
Node: Type = News
Node: Published Yes
Date: Date (node) Content: Publish Date (field_pub_date) between now -2 days and now
Domain Source: Domain Source ID = Current Domain
Comment #2
fas commentedThanks Mikey!
Just what I was looking for!
The example you put working perfectly.
What is not working is the part that replaces the "(urlset)" by "(urlset mln = "http://www.sitemaps.org/schemas/sitemap/0.9" xmlns: n = "http://www.google.com / schemas/sitemap-news/0.9 ">)"
The third PHP code you put this into a custom module.
But the part of, mymodule_preprocess_views_views_xml_style_raw, it seems not working.
Can you give me a hand?
Sorry for the bad English.
Greetings from Argentina!
Comment #3
mikeytown2 commentedTheme functions require a clear cache in order to work. Try clearing your caches and give it another go.
Comment #4
fas commentedThanks!!! Is working now!
Regards!
Comment #5
zeip commentedDrupal 6 has been EOL for some years, closing all D6 issues.