User tests: Successful: Unsuccessful:
Submission of an alternative to the current JMicrodata library class.
This is a rewrite of the microdata functionality in Joomla 3.2 and addresses many of the shortcomings of the current implementation. Additionally, the classes better fit Joomla's separation of presentation and application functionality by providing JHTML functionality within the CMS and adding the core microdata classes to the Joomla lib.
The Schema class sets up a named schema from which sub-schemas and snippets can be created.
The Snippet class builds a snippet and addresses many of the shortcomings of the current JMicrodata class. Features such as multiple properties and the ability to add snippets to any HTML element tag are some of the improvements. The Snippet class also does away with the typed schema allowing for any type of microdata to be handled. The functions also simplify the construction of these snippets.
JHtmlMicrodata provides a quick method to build snippets and scopes using the existing JHtml::_() feature rather than the current HTML* methods which work against Joomla's architecture.
My preference would have been to include unit tests but I was unable to run unit tests using Joomla 3.2 and PHPUnit (various errors resulted in my abandoning unit tests for now).
Simple examples:
// use the Microdata lib.
$mdarticle = new JMicrodataSchema('http://schema.org/Article');
echo $mdarticle->getSnippet()->scope(true)->properties(array('name','headline'))->meta();
echo $mdarticle->getSnippet()->properties('author')->content('Hayden Young')->itemref('test')->html('h1');
// Use JHTML::();
echo JHtml::('microdata.snippet', 'div', 'author', 'Hayden Young', array('class'=>'pull-right'));
echo JHtml::_('microdata.scope', 'h2', 'http://schema.org/Person', 'author', 'Hayden Young');
Is this fully functional for Joomla 3.2?
Yes although I would like to set up some unit testing as part of the testing procedure but I'm unable to get the Joomla core unit tests to run without errors. So there aren't any microdata unit tests at this time.
Status | New | ⇒ | Pending |
Build | ⇒ | . |
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-09-15 20:11:18 |
Tracker:http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=32374&start=0