ZF-10796: Add XHTML1 RDFA doctype to Zend_View_Helper_Doctype
Description
This doctype allows a developer to use the Resource Description Framework:
http://www.w3.org/TR/xhtml-rdfa-primer/
Using this doctype is necessary if you wish to specify the property or rel component of a tag.
This allows labeling items to be picked up by the browser:
- Set the title and creator - uses Dublin Core (dc from purl.org)
The trouble with Bob
Alice
...- You can also attribute a license:
All content on this site is licensed under a Creative Commons License .
- This is also needed to get pages to validate when using the Open Graph Protocol:
This is used for Facebook enhanced pages.
Comments
Posted by Jeremy Postlethwaite (gammamatrix) on 2010-12-08T12:50:16.000+0000
Here is the diff to the DocTypeTest:
Posted by Jeremy Postlethwaite (gammamatrix) on 2010-12-08T12:55:16.000+0000
Here is the diff to the view helper
Posted by Marc Hodgins (mjh_ca) on 2010-12-08T14:22:31.000+0000
Hi Jeremy, I like this idea of building in convenience for implementing RDFa, especially since Facebook implements opengraph.
A few questions -
1) Doesn't adding the namespace as an attribute to the tag also accomplish the same thing without adding a new doctype? (The opengraph site documents this approach). It would allow this to apply to more than one version of HTML (i.e. HTML5).
2) If approaching it like this via adding a DOCTYPE, why not add an HTML5 RDFa doctype as well? (i.e. Zend_View_Helper_Doctype::HTML5_RDFA) - see [http://dev.w3.org/html5/rdfa/]
Posted by Jeremy Postlethwaite (gammamatrix) on 2010-12-08T14:50:55.000+0000
Hi Marc, you do not need to have the RDFa doctype to implement Open Graph. Using RDFa ensures your page will validate. If you use any other doctype, you will get flagged by a validator for using "property"
Posted by Jeremy Postlethwaite (gammamatrix) on 2010-12-08T14:54:59.000+0000
HTML5_RFDA
test
Posted by Marc Hodgins (mjh_ca) on 2010-12-08T20:29:10.000+0000
Revised patch attached which consolidates Jeremy's changes, adds documentation and adds an isRdfa1() method to allow view helpers to differentiate behavior.
Posted by Jeremy Postlethwaite (gammamatrix) on 2010-12-10T10:27:44.000+0000
I attached another patch.
This includes the previous patch with the test and code. It also adds documentation in English on how to use the doctype with Open Graph.
Posted by Jeremy Postlethwaite (gammamatrix) on 2010-12-16T14:49:40.000+0000
Committed code in r23525
Posted by Marc Hodgins (mjh_ca) on 2010-12-17T22:38:06.000+0000
isRdfa() method of Zend_View_HelperDoctype added in r23538, merged to 1.11 release branch in r23539
Posted by Jeremy Postlethwaite (gammamatrix) on 2010-12-18T12:53:25.000+0000
It is in there:
http://framework.zend.com/svn/framework/…
I did forget to include your patch the first time I checked it in.
I am not sure which revision.