? ? Success
Related to # 4118

User tests: Successful: Unsuccessful:

avatar PAlexcom
PAlexcom
13 Sep 2014

This pull request includes the plg_system_microdata plugin #4118 pull request.

THINGS DISCUSSED

1) Where is saved the com_content microdata information.
Discussion link: https://twitter.com/PAlexcom/status/513414081534263297
microdata-database

HOW TO TEST

First I recommend reading this article http://magazine.joomla.org/issues/issue-aug-2014/item/2233-rich-snippets-structured-data-microdata-rdfa-isnt-so-simple

Also make sure you have the plg_content_vote and plg_system_microdata both enabled.

You will also need this tool provided by google to test the markup and the SERP (Search Engine Result Page) preview https://www.google.com/webmasters/tools/richsnippets

Not necessary, but you could also validate the HTML by using this tool http://validator.w3.org

Step by step

  1. Go in the Administration area, then from the top menu select: Content → Article Manager
  2. Now select and press Edit on any article
  3. From the option tab select: Publishing administration - article manager edit article
  4. At the bottom right of the page you should find: administration - article manager edit article microdata

Previews and results

At this point you can change one of the 5 available microdata schema.org types.

Article

Backend configuration:

admin - administration - article manager edit article microdata-article

Preview of the rich snippet in the SERP of Google:

google structured data testing tool article

Event

Backend configuration:

administration - article manager edit article event

Frontend output:

beginners frontend event

Preview of the rich snippet in the SERP of Google:

google structured data testing tool event

Product

Backend configuration:

administration - article manager edit article product

Preview of the rich snippet in the SERP of Google:

google structured data testing tool product

Recipe

Backend configuration:

administration - article manager edit article recipe

Frontend output:

beginners frontend recipe

Preview of the rich snippet in the SERP of Google:

google structured data testing tool recipe

Review

Backend configuration:

administration - article manager edit article review

Preview of the rich snippet in the SERP of Google:

google structured data testing tool review


For more information on how everything is implemented and the syntax please read here #4118

avatar PAlexcom PAlexcom - open - 13 Sep 2014
avatar jissues-bot jissues-bot - change - 13 Sep 2014
Labels Added: ?
avatar PAlexcom
PAlexcom - comment - 14 Sep 2014

I'm pretty sure that the microdata configuration in the backend should not be under 'Publishing' → Metadata options. Any ideas @betweenbrain @Bakual ?

avatar zero-24
zero-24 - comment - 14 Sep 2014

@PAlexcom

I have install your branche on my test envoriement and im going now step by step for testing.

My results

Article

screen shot 2014-09-14 at 12 02 46

Event

screen shot 2014-09-14 at 12 02 58

Product

screen shot 2014-09-14 at 12 03 07

Recipe

screen shot 2014-09-14 at 12 03 17

Review

screen shot 2014-09-14 at 12 03 28

Notes

  • The meta values e.g. for location etc. are setted every time is this expected?
<meta name="microdata_event_location" content="New York2" />
<meta name="microdata_event_startdate" content="2014-09-15 15:04:00" />
<meta name="microdata_event_enddate" content="2014-09-20 15:04:23" />
<meta name="microdata_recipe_preptime" content="1" />
<meta name="microdata_recipe_cooktime" content="1" />
<meta name="microdata_recipe_ingredients" content="2 eggs, 1 cup of rice" />
<meta name="microdata_recipe_calories" content="250" />
  • If we have a vote button but no vote atm Google send a "Error"
    screen shot 2014-09-14 at 12 03 43

  • On every site i have test we have a aggregaterating: Item 1/2 Is this expected?

@PAlexcom can we test more or it is only a validate by google?

This comment was created with the J!Tracker Application at http://issues.joomla.org/.

avatar zero-24 zero-24 - change - 14 Sep 2014
Category Front End Libraries Plugins SEF
avatar zero-24
zero-24 - comment - 14 Sep 2014

BTW @PAlexcom i can't confirm that my values e.g. for the event is shown on the article as you have it on your scennshots. Or need this only to enabled on a place?

avatar PAlexcom
PAlexcom - comment - 15 Sep 2014

@zero-24 thanks for helping and testing :)

On every site i have test we have a aggregaterating: Item 1/2 Is this expected?

Every time you see Item 1 or Item 2 and so on Item n... in the extracted structured data with the use of Structured Data Testing Tool, means that the information is another group item, e.g.
google structured data testing tool 2014-09-15 16-51-32
So it is not an error.

can we test more or it is only a validate by google?

You could also validate the HTML by using this tool http://validator.w3.org/

If we have a vote button but no vote atm Google send a "Error"

It simply means that there isn't available any vote yet, and that Google will not display rich snippet until a vote will be submited. So it is not an error.

Missin required fields. i can't confirm that my values e.g. for the event is shown on the article as you have it on your scennshots. Or need this only to enabled on a place?

You need to enable the article Details options e.g. Show Hits, Show Author... in order to have a similar frontend output.
7f167fba-3b5a-11e4-99ce-184ff2b69152
If that doesn't work, could you post a screenshot of your frontend?

<meta name="microdata_event_location" content="New York2" />
<meta name="microdata_event_startdate" content="2014-09-15 15:04:00" />
<meta name="microdata_event_enddate" content="2014-09-20 15:04:23" />
<meta name="microdata_recipe_preptime" content="1" />
<meta name="microdata_recipe_cooktime" content="1" />
<meta name="microdata_recipe_ingredients" content="2 eggs, 1 cup of rice" />
<meta name="microdata_recipe_calories" content="250" />

That's why microdata configuration in the backend should not be under 'Publishing' → Metadata options. Because all the metadata information before rendering is inserted in the page header. Do you have any suggestion?

avatar zero-24
zero-24 - comment - 19 Sep 2014

Do you have any suggestion?

hmm add only the selected/expected values. Like check wich type it is e.g. event than add the event microdata if it is a article don't add the event or other microdata or i missing something?

You could also validate the HTML by using this tool http://validator.w3.org/

This was shown 6 errors

Validation Output: 6 Errors

    Error Line 8, Column 49: Bad value microdata_types for attribute name on element meta: Keyword microdata_types is not registered.

      <meta name="microdata_types" content="Event" />

    Syntax of metadata name:
        A metadata name listed in the HTML specification or listed in the WHATWG wiki. You can register metadata names on the WHATWG wiki yourself. 

    Error Line 9, Column 61: Bad value microdata_event_location for attribute name on element meta: Keyword microdata_event_location is not registered.

      <meta name="microdata_event_location" content="New York" />

    Syntax of metadata name:
        A metadata name listed in the HTML specification or listed in the WHATWG wiki. You can register metadata names on the WHATWG wiki yourself. 

    Error Line 10, Column 73: Bad value microdata_event_startdate for attribute name on element meta: Keyword microdata_event_startdate is not registered.

      <meta name="microdata_event_startdate" content="2014-09-18 18:35:11" />

    Syntax of metadata name:
        A metadata name listed in the HTML specification or listed in the WHATWG wiki. You can register metadata names on the WHATWG wiki yourself. 

    Error Line 11, Column 71: Bad value microdata_event_enddate for attribute name on element meta: Keyword microdata_event_enddate is not registered.

      <meta name="microdata_event_enddate" content="2014-09-26 18:35:13" />

    Syntax of metadata name:
        A metadata name listed in the HTML specification or listed in the WHATWG wiki. You can register metadata names on the WHATWG wiki yourself. 

    Error Line 12, Column 55: Bad value microdata_recipe_preptime for attribute name on element meta: Keyword microdata_recipe_preptime is not registered.

      <meta name="microdata_recipe_preptime" content="1" />

    Syntax of metadata name:
        A metadata name listed in the HTML specification or listed in the WHATWG wiki. You can register metadata names on the WHATWG wiki yourself. 

    Error Line 13, Column 55: Bad value microdata_recipe_cooktime for attribute name on element meta: Keyword microdata_recipe_cooktime is not registered.

      <meta name="microdata_recipe_cooktime" content="1" />

    Syntax of metadata name:
        A metadata name listed in the HTML specification or listed in the WHATWG wiki. You can register metadata names on the WHATWG wiki yourself. 

You need to enable the article Details options e.g. Show Hits, Show Author... in order to have a similar frontend output.

hmm yes that work. But should this expected?
E.g. if I want only show the microdata or i don't what it show?
Atm if one of the options is show e.g. the "Modify Date" the microdata values will show and i can't hide there or add it exclusively (without other values)

BTW: Github says: This pull request contains merge conflicts that must be resolved.



This comment was created with the J!Tracker Application at http://issues.joomla.org/.

avatar PAlexcom PAlexcom - change - 20 Sep 2014
The description was changed
avatar PAlexcom
PAlexcom - comment - 20 Sep 2014

Thanks @zero-24

Validation Output: 6 Errors

Solved.

BTW: Github says: This pull request contains merge conflicts that must be resolved.

As far I know I can't do anything, there is a merge conflict in /modules/mod_articles_latest/tmpl/default.php, only the person with merge permissions can fix it.

hmm yes that work. But should this expected?
E.g. if I want only show the microdata or i don't what it show?
Atm if one of the options is show e.g. the "Modify Date" the microdata values will show and i can't hide there or add it exclusively (without other values)

Well ..., that's true. But that means that there will be more on/off option buttons. As discussed long time ago (https://twitter.com/betweenbrain/status/446622447417425920) a lean interface is preferred. This is one of the things that must be discussed here :)

avatar mbabker
mbabker - comment - 20 Sep 2014

BTW: Github says: This pull request contains merge conflicts that must be resolved.

As far I know I can't do anything, there is a merge conflict in /modules/mod_articles_latest/tmpl/default.php, only the person with merge permissions can fix it.

Actually, if you just do a git merge of the current staging branch into your branch, that'll let you resolve the conflicts and the GitHub UI will show a clean merge again.

Plus, this is a good way to gauge if any changes to the repo may have affected your code.

avatar Bakual
Bakual - comment - 20 Sep 2014

Well ..., that's true. But that means that there will be more on/off option buttons. As discussed long time ago (https://twitter.com/betweenbrain/status/446622447417425920) a lean interface is preferred. This is one of the things that must be discussed here :)

Imho: Keep it as simple as possible. Only add options where the customisation can't be easily done in a template override.

avatar PAlexcom PAlexcom - change - 20 Sep 2014
The description was changed
avatar schnuti
schnuti - comment - 25 Sep 2014

Do I understand this correctly?
You are trying to implement content types by using microdata in com_content?
I do not know the future of the J3 UCM ( _ucm_content ), but that would be the place to introduce NEW content types. Mixing microdata for articles with events, books, recipes ... will hurt Joomla for the next generation`s backward compatibility.

I guess that Google and Co accepts any event, book or recipe as an article but will not categorise it as an event, book or recipe.

I suggest to leave non article microdata to other extensions than com_content. New core extensions or not.

You would need overrides for the examples above anyway. e.g. do you think someone adds the recipe directions and ingredients twice. 1. for the microdata 2. for the text.

The JMicrodata is still useful in the right context.


This comment was created with the J!Tracker Application at http://issues.joomla.org/.

avatar Bakual
Bakual - comment - 25 Sep 2014

I do not know the future of the J3 UCM ( _ucm_content ), but that would be the place to introduce NEW content types.

Please don't use the #__ucm_... for anything new. The future of those tables is a place 6 feets under.

avatar PAlexcom
PAlexcom - comment - 25 Sep 2014

@schnuti Thanks for your feedback :)

You are trying to implement content types by using microdata in com_content?

Definitely no. Here I'm trying to implement microdata semantics in com_content and later in the CMS.

Mixing microdata for articles with events, books, recipes ... will hurt Joomla for the next generation`s backward compatibility.

Not true. There isn't any dependency regarding the new configurations in com_content (any sql query, filter, ...).

I guess that Google and Co accepts any event, book or recipe as an article but will not categorise it as an event, book or recipe.

This is why we use microdata, so that Google could categorise an Article as an Event, Book or Recipe. Please try to test or read the "How to test" instructions and you will see that it does.

You would need overrides for the examples above anyway.

With the use of plg_system_microdata you don't need any overrides, it uses the fallbacks mechanism, you write one layout that works for all, please take a look here to see how it works #4118

e.g. do you think someone adds the recipe directions and ingredients twice. 1. for the microdata 2. for the text.

I agree with you, but it is not necessary. With the current configuration you insert the recipe and ingredients once (for the microdata), and it will be displayed in the frontend.

avatar schnuti
schnuti - comment - 25 Sep 2014

Thanks Bakual, nice to know. Has some implications on the use of newly introduced features.

If com_content has to handle different content types, it should be able to handle custom fields in a better way than adding them as json in a common field.

I still find com_content = articles as long as not using third party developers tweaks, with plugins and overrides.

avatar schnuti
schnuti - comment - 25 Sep 2014

@PAlexcom
We do not disagree about the Microdata semantics only about what com_content is. If not as Ucm - It has to be extended to be able to handle other content types. I do not see a great difference between Content Types and the XXX Microdata Types. And as written by others, it`s not that easy to override the many views and layouts of com_content as is, only containing articles.

avatar blueforce blueforce - test_item - 10 Oct 2014 - Tested successfully
avatar trangredweb trangredweb - test_item - 17 Oct 2014 - Tested successfully
avatar trangredweb
trangredweb - comment - 17 Oct 2014

@test

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4276.

avatar roland-d roland-d - alter_testresult - 8 Nov 2014 - trangredweb: Not tested
avatar roland-d
roland-d - comment - 8 Nov 2014

Hello,

There are a few problems that prevents us from testing this request. First of all the full zip reference mentioned at the top throws a 404 not found. So there is no full working demo available. The PR itself it out of sync and has merge conflicts. Trying to apply it manually generates a list of errors:
error: patch failed: components/com_content/views/article/tmpl/default.php:43
error: components/com_content/views/article/tmpl/default.php: patch does not apply
error: patch failed: language/en-GB/en-GB.ini:200
error: language/en-GB/en-GB.ini: patch does not apply
error: patch failed: layouts/joomla/content/intro_image.php:17
error: layouts/joomla/content/intro_image.php: patch does not apply
error: patch failed: layouts/joomla/content/tags.php:18
error: layouts/joomla/content/tags.php: patch does not apply

Please update your PR, at the moment this PR cannot be tested. Sorry.

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4276.

avatar Kubik-Rubik
Kubik-Rubik - comment - 8 Nov 2014

I can confirm @roland-d 's observation. Please update the PR to the current staging state. Thanks!

avatar RCheesley RCheesley - test_item - 16 Nov 2014 - Tested successfully
avatar RCheesley
RCheesley - comment - 16 Nov 2014

Successful test on Joomla 3.3.6, tested all schemas and am able to reproduce the rich snippets that would be expected.

Simple and easy to use.

If others wish to test you can install the microdata system plugin from this repo: https://github.com/PAlexcom/plg_system_microdata just download the zip and install.

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4276.

avatar PAlexcom PAlexcom - change - 16 Nov 2014
The description was changed
avatar PAlexcom
PAlexcom - comment - 16 Nov 2014

@roland-d @Kubik-Rubik @RCheesley I've updated the PR to the current staging state. Thanks for testing ;)

avatar waader
waader - comment - 24 Nov 2014

I was unable to apply 4276.diff to the current staging. Here are the error messages:

error: patch failed: language/en-GB/en-GB.ini:201
error: language/en-GB/en-GB.ini: patch does not apply
error: patch failed: layouts/joomla/content/intro_image.php:19
error: layouts/joomla/content/intro_image.php: patch does not apply
error: patch failed: layouts/joomla/content/tags.php.20
error: layouts/joomla/content/tags.php: patch does not apply

So I tried it with com_patchtester and eventually the patch was successfully applied. It took me then a while to figure out, that I have to go to the "Extension manager" -> "Discover" to install the plugin. After enabling the plugin I did some testing and everthing went fine so far. I will do some more testing tomorrow.

avatar roland-d
roland-d - comment - 24 Nov 2014

@waader that is strange, I had no problems applying the patch against the current staging using the command line. Maybe you had some other changed files in there?

Test results

Article/Recipe/Review
All OK

Event/Product
Element meta is missing one or more of the following attributes: itemprop, property.

Attributes for element meta:
Global attributes
name
http-equiv
content
charset

avatar PAlexcom
PAlexcom - comment - 26 Nov 2014

@roland-d @waader Thanks for testing!
@waader it's strange that it's not working, could you try again please, I've fixed some merge issues.

@roland-d Could you please attach a screenshot of the problems? Probably the meta elements are missing because of the template which is not related to this PR. Or more probably you haven't enabled the Content - Vote plugin?

avatar waader
waader - comment - 27 Nov 2014

@PAlexcom Thanks! I can now apply the patch and I have done several tests. I have tested all five microdata types and verified them with the googles webmaster tool for microdata. That went fine. I also check the output with the W3C markup validation service (http://validator.w3.org/check).

When I validate the "Menu Item Type" -> "Category Blog" with articles of the different microdata types I get errors like this one, which I don´t get, when I am not applying your patch:

Error Line 137, Column 147: Element meta is missing one or more of the following attributes: itemprop, property.

60;<span >5</span><meta content="0" /><meta content="0" /></p><img src="/joo…

Attributes for element meta:
Global attributes
name
http-equiv
content
charset

I think this is what @roland-d is refering to.

avatar roland-d roland-d - change - 29 Nov 2014
Rel_Number 4118
Relation Type Related to
avatar roland-d
roland-d - comment - 1 Dec 2014

@PAlexcom @waader Indeed that is what I was talking about, my screenshot below:
content_w3c_validation_error

Here is the HTML content for that part:

<dl class="article-info">
            <dt class="article-info-term">Details</dt>

                            <dd class="createdby" >
                                                                                    Written by <span itemprop='name'>Super User</span>                                  </dd>
                                                    <dd class="category-name">
                                                                                        Category: <a href="/joomla-cms/index.php?option=com_content&amp;view=category&amp;id=64&amp;Itemid=411" >Content Modules</a>                                    </dd>

                            <dd class="published">
                    <span class="icon-calendar"></span>
                    <time datetime="2013-10-31T00:43:46+00:00" >
                        Published: 31 October 2013                  </time>
                </dd>


                                    <dd class="hits">
                        <span class="icon-eye-open"></span>
                        <meta  content="UserPageVisits:16" />
                        Hits: 16                    </dd>
                                            <dd class="location">
    Location:   <span itemprop='location'>
        Hoogvliet   </span>
</dd>
<dd class="startDate">
    <span class="icon-calendar"></span>
    <time datetime="2014-11-11T22:48:27+00:00" itemprop='startDate'>
        Start date: Tuesday, 11 November 2014 22:48 </time>
</dd>
<dd class="endDate">
    <span class="icon-calendar"></span>
    <time datetime="2014-11-27T22:48:00+00:00" itemprop='endDate'>
        End date: Thursday, 27 November 2014 22:48  </time>
</dd>           </dl>

What I also noticed, despite having the Voting plugin enabled, I don't see any option to vote.

avatar AlexdeBorba
AlexdeBorba - comment - 26 Jan 2015

Missing is Local, Person, Audio and Video, which is quite handy for news publishing websites, such as online magazines.

Product does not load fields to fill, such as UPC and ISBN which is quite handy.

avatar waader
waader - comment - 24 Feb 2015

As I read about a new validation service for microdata today I came back to your patch and analyzed the problem raised by @roland-d.

Two side notes:

  • This patch is out of sync with current staging and needs a little "tweaking" before it could be installed with the current staging branch. Just apply your patch and take the current joomla.sql as there was a schema change in the meantime.
  • I only saw today that there a two more patches #4108 and #4118 and I wonder why that is as it seems that they are included in this patch.

So I installed the tweaked current staging branch including your patch with the testing sample data, activated the plugin and took the first article - popular tags - and selected event as microdata type.

After that I validated the result with the service available at http://www.w3.org/blog/SW/2012/02/08/new-w3c-validation-service-with-rdfa-1-1-and-microdata/. There are two problems indicated:

One that is unrelated to the microdata extension: In the article "popular tags" - also in many others - there is the line

<p>{loadmodule tags_popular,Popular Tags}</p>

which makes the validator scream because after rendering you will have a <p> tag that encloses a lot of <div> tags. Changing this <p> to <div> and everything is fine.

Then there is the line
<meta content="UserPageVisits:5" />

The first thing I noticed are the two empty space between meta and content. So I looked in the corresponding layout file and found this line:
<meta data-sd="interactionCount" content="UserPageVisits:<?php echo $displayData['item']->hits; ?>" />

So why is data-sd="interactionCount" parsed out?

Last but not least I had a look at a google service at https://developers.google.com/structured-data/testing-tool/ that evaluates structured data markup. There I get to 2 errors and 1 warning. Googles is complaining that the field "address" is missing and the field "location" has to be filled. It also recommends to add the field "offer".

joomla_microdata

avatar designbengel
designbengel - comment - 14 Mar 2015

Is this function to be extended in the future? I miss some fields in the microdata function. Like SoftwareApplication, Movie, Book, Person, Organisation, and many more ... ?
I just wonder if it´s suffices to everyones needs.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4276.
avatar zero-24 zero-24 - alter_testresult - 11 Jun 2015 - blueforce: Not tested
avatar zero-24 zero-24 - alter_testresult - 11 Jun 2015 - RCheesley: Not tested
avatar roland-d roland-d - change - 20 Aug 2015
Status Pending Information Required
avatar roland-d
roland-d - comment - 20 Aug 2015

Hello @PAlexcom

Thank you for your contribution.

The last comment here was on 14th March. So the question is, Is this issue/pull request still valid?
If no reply is received within 4 weeks we will close this issue.

Thanks for understanding!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4276.

avatar PAlexcom
PAlexcom - comment - 22 Aug 2015

Hello @roland-d, this PR isn't valid and outdated, can be closed.

avatar Bakual Bakual - change - 22 Aug 2015
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2015-08-22 19:28:10
Closed_By Bakual
avatar Bakual Bakual - close - 22 Aug 2015
avatar Bakual Bakual - close - 22 Aug 2015
avatar joomla-cms-bot joomla-cms-bot - change - 22 Aug 2015
Labels Added: ?
avatar Bakual
Bakual - comment - 22 Aug 2015

Closed as requested

Add a Comment

Login with GitHub to post a comment