Google news doesn't include News item image - best way to add a file extension to the url
We've configured our site so that our news section appears in Google news by regularly submitting a news sitemap to Google. Unfortunately since migrating to Plone our news items that appear in Google no longer have a picture associated with them. Having looked at the Google news guidelines for images it seems this is almost certainly because the image url for the image added to the Plone News item doesn't include a file extension.
We'd like to fix this and my plan is roughly:
* add a method to that returns the image url suffixed with the appropriate file extension for the image. I'm thinking I should do this with an adaptor
* use this method in our news item template (we already override this)
* get newsitem to ignore the suffix when serving the image
This last part I'm a bit stuck on. Can I do this with an adaptor as well or do I need to override the ATNewsItem.__bobo_traverse__ somehow (how would I do that?).
We're on Plone 3.3.3 at the moment but are planning to upgrade to 3.3.5 this release.
Re: Google news doesn't include News item image - best way to add a file extension to the url
This looks like it'll work. Can you register BrowserViews with wildcards? e.g. myimagedownloader.*
On 16/10/2010 23:16, Mikko Ohtamaa wrote:
> A possible solution:
> 1) Create a new BrowserView called "ImageDownload" and register it with name
> @@myimagedownloader.jpeg against ATNewsItem
> 2) Modify news / sitemap code so that this view is used for images
> http://yoursite/news/@@imagedownload.jpeg >
> 3) The ImageDownload view copies the image binary streaming code from
> ATImage and also sets some HTTP headers if required by Google