You are here: Home News How to validate google webmaster tools with diazo

How to validate google webmaster tools with diazo

by Jean-Michel FRANCOIS last modified Dec 21, 2011 06:22 PM
Using diazo alter common output so google webmaster tools are unvalidate once you activate your diazo theme. This article show how you can re validate it.
How to validate google webmaster tools with diazo

Google webmaster tools

On the CMS Plone I'm used to validate google webmaster tools by adding in ZMI the file provided by Google during the validation process.

google webmaster tools ZMI

But once you have activated a diazo theme, Plone add doctype header.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

Google can't validate this and warn you about this:

google webmaster tools warning

To fix this there is a simple solution. grab the content of this file and create a Script (Python) in ZMI with id (filename Google has given to you, something like googlexxx.html)

Paste this code replacing CONTENT by the content of the file:

res = "CONTENT"
context.REQUEST.response.setHeader('X-Theme-Disabled', 'True')
return res

That way plone.app.theming will do nothing and your site will be validated by Google.

 

This apply also to any content/view you want to be not themed by diazo and is documented in plone.app.theming.

Share |
Filed under: ,
comments powered by Disqus