Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I created a patch to allow Views Bonus Pack to export a Google News Sitemap. This provides some flexibility over the Google News sitemap module because this patch uses the Labels from the fields in Views as the attribute names, similar to this ICS file format patch. As a result, this patch provides a way of supporting the optional tags, such as <access>, <genres>, <keywords>, and/or <stock_tickers>
.
A few tips for using this method to generate the feed:
- Set Items to display to 1000
- For the
<publication_date>
attribute, use the following Custom format: Y-m-d\TH:i:s+00:00 - The last (ie, bottom-most) field designated in the view will be used as the
<loc>
attribute. - Add a sort criteria of Node: Post date set to Descending
- Be sure to add a filter with Node: Published set to Yes
- Add a filter with Node: Post date set to Is greater than or equal to…An offset… of -2 days
Or import the attached example view as a starting point.
Comment | File | Size | Author |
---|---|---|---|
#5 | views_bonus.zip | 317.79 KB | Matt V. |
#4 | views_bonus.zip | 644.54 KB | Matt V. |
google_news_sitemap_example_view.txt | 4.51 KB | Matt V. | |
google_news_sitemap.patch | 3.98 KB | Matt V. |
Comments
Comment #1
stockmaster1 CreditAttribution: stockmaster1 commentedHi Matt, this is exactly what I'm looking for. Question for you, I've never installed a drupal patch before - can you point me in the right direction? Thanks
Comment #2
Matt V. CreditAttribution: Matt V. commentedstockmaster1, the Verson control tab on the module's project page includes instructions on how to apply patches.
I'd love to hear any feedback you may have, once you get a chance to try it out.
Comment #3
stockmaster1 CreditAttribution: stockmaster1 commentedHi Matt,
I've been pulling my hair out all weekend trying to figure out how to do this, downloaded smartgit, cygwin, but I'm not a web developer and none of it makes any sense to me. If there was just a way to upload the patched module that would be awesome. Otherwise it seems that I may be out of luck :(
Comment #4
Matt V. CreditAttribution: Matt V. commentedstockmaster1, give the attached (patched) version a try.
In case it might help later, I recommend checking out the Quickstart project, to get a jump start on developing with Drupal. It includes the tools you need to checkout and patch, plus there are video tutorials to help you along the way.
Comment #5
Matt V. CreditAttribution: Matt V. commentedOops, I made a mistake creating the previous zip, accidentally including the files twice. Please try this one instead.
Comment #6
neclimdul