? ? Success

User tests: Successful: Unsuccessful:

avatar haydenyoung
haydenyoung
21 Oct 2013

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');

avatar haydenyoung haydenyoung - open - 21 Oct 2013
avatar nuwud
nuwud - comment - 30 Oct 2013

Is this fully functional for Joomla 3.2?

avatar haydenyoung
haydenyoung - comment - 31 Oct 2013

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.

avatar brianteeman brianteeman - change - 21 Aug 2014
Status New Pending
Build .
avatar joomla-jenkins joomla-jenkins - close - 15 Sep 2014
avatar joomla-jenkins joomla-jenkins - merge - 15 Sep 2014
avatar joomla-jenkins joomla-jenkins - close - 15 Sep 2014
avatar joomla-jenkins joomla-jenkins - change - 15 Sep 2014
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2014-09-15 20:11:18

Add a Comment

Login with GitHub to post a comment