Structured-Data > Microdata > Schema > Article > Author Itemscope > Properties > Google Validation Error - markup

I am developing my own site locally. This is my first site so I am a relative 'noob'.
I have begun the process of marking up my site with the microdata format using the schema.org vocabulary.
I am using Google's structured data tester to test my microdata markup.
On a webpage I have marked up an article.
THE PROBLEM
I am getting errors for all properties for a person itemscope successfully connected to the article itemscope. It does not matter how the person is linked, whether as author or creator or otherwise.
For example, if I link a person to the article using the author property and try to then mark up their name with the name property, it gives a red error roughly like so:
!
http://www.example.com/name: Name
Where the property name is the cited in a url/property format, and where 'Name' is the property value I actually want.
If I then click on the error message, it says:
The property http://www.example.com/name is not recognised by Google
for an object of type Thing.
It is otherwise:
showing the other article properties fine; and
creating an person-type property for the article fine (eg author, creator, etc); and
creating name:value pairs for properties of the person (eg name).
But it just doesn't recognise the properties of the person.
MARKUP SAMPLE
Here is a sample of how I am marking it up:
<html>
...
<div itemprop="hasPart" itemscope="itemscope" itemtype="https://schema.org/Article">
<h1 itemprop="headline name">
Awesome Things
</h1>
<div itemprop="articleBody">
Blah blah blah ... FLUFFY KITTENS ... blah blah blah ... DONUTS ... blah blah blah ... COFFEE!!! ...
AUTHOR:
<span itemprop="author" itemscope="itemscope" itemptype="https://schema.org/Person">
<span itemprop="name">
Joe Blogs-a-Lot
</span>
</span>
</div>
...
</div>
</html>
TRIED
I have tried testing with alternate properties with person as an expected type (author and creator). Same result.
I have also tried wrapping person itemscope around the properties, and using itemref and ID to target the values. This works, but has the downside of adding those values to properties in common with the article. So, for example, the article gets the additional name value of Joe Blogs-a-Lot - which isn't correct.
INVESTIGATIONS
I have had a bit of a look-see but couldn't quite find a specific answer - which surprised me.
I did notice that there were reports of issues with the testing tool. For example, I note this answer from the AWESOME CONTRIBUTOR in this area, the mighty #unor. If you see this, Unor, thanks for all the help you have provided to so many people here about this stuff. You rock.
THE ACTUAL QUESTION
Am I doing something dumb (a distinct possibility from past experience), or is this an issue with the tester?

Your markup sample contains a typo:
itemptype="https://schema.org/Person"
should be
itemtype="https://schema.org/Person"
Unfortunately, the Google Structured Data Testing Tool doesn’t report such errors. (And they shouldn’t have interpreted the property name as the URL http://www.example.com/name, because an item without a type could have a proprietary item property name, which would not be a URL.)
On a side note: You might want to use http instead of https for the Schema.org URLs.

Related

Extracting links (get href values) with certain text with Xpath under a div tag with certain class

SO contributors. I am fully aware of the following question How to obtain href values from a div using xpath?, which basically deals with one part of my problem yet for some reason the solution posted there does not work in my case, so I would kindly ask for help in resolving two related issues. In the example below, I would like to get the href value of the "more" hyperlink (http://www.thestraddler.com/201715/piece2.php), which is under the div tag with content class.
<div class="content">
<h3>Against the Renting of Persons: A conversation with David Ellerman</h3>
[1]
</p>
<p>More here.</p>
</div>
In theory I should be able to extract the links under a div tag with
xidel website -e //div[#class="content"]//a/#href
but for some reason it does not work. How can I resolve this and (2nd part) how can I extract the href value of only the "here" hyperlink?

CKEditor is modifying my HTML source - and not for the better. Any way to prevent this?

I realize there are many questions about CKEditor modifying HTML source. But none of the suggestions appear to work.
In particular, the most general suggested change:
config.allowedContent = true;
seems to help quite a bit, but a lot still gets changed.
For example, the following HTML entered in SOURCE mode gets modified.
Original:
<p><a name="top"></p>
<p>Over the course of its 2 phases the ACCRA programme has co-authored and published a large collection of reports, case studies, evaluations and working papers. These are all available to download for free here.<br>
Our resources are categorised as follows: General Programme Information | Research reports | Country case studies | Phase 1 Evaluation | Working papers| Publications in Portuguese</p>
Turns into this:
<div> </div>
<p><a name="top"></a></p>
<p><a name="top"> </a></p>
<p><a name="top">Over the course of its 2 phases the ACCRA programme has co-authored and published a large collection of reports, case studies, evaluations and working papers. These are all available to download for free here.<br>
Our resources are categorised as follows: </a>General Programme Information | Research reports | Country case studies | Phase 1 Evaluation | Working papers| Publications in Portuguese</p>
Duplicated lines and even spaces are added.
Another example:
Original:
<div style="clear: both"></div>
<p></p>
<p></p>
Becomes this:
<div style="clear: both"> </div>
<p> </p>
<p> </p>
I could go on, but you get the point.
The changed source gets rendered differently from the original. For example, rows of publications which were nicely aligned get slightly misaligned if opened and then saved in the CKEditor.
Is there a way of telling CKEditor to please leave my valid HTML source as is?
The option config.allowedContent = true; should do the trick for leaving your VALID html code intact.
But in the case that there is no valid html code it will try to correct it in order to show it correctly (that is because CKEditor is not a code writing tool but a WYSIWYG tool).
In your first example your html is not valid (<p><a name="top"></p>). The <a> tag should have a corresponding </a> end tag.
In your second example you can disable the automatic fillup of empty tags with the using the option:
config.fillEmptyBlocks = false;

Is it possible to add custom attributes in Microdata?

Is there an option to add custom attributes to a scheme? (same as we can expand DTD?)
itemprop="description" isn't enough for me. I got more attributes that I wish to add, that do not exist in the original scheme:
Objective
Duration
Availability
I need this attributes cause they project the full characteristic of my product.
In Microdata, you can use a "proprietary item property name":
one used by the author for private purposes, not defined in a public specification
It has to be an absolute URL, e.g.:
<div itemscope itemtype="http://schema.org/Thing">
<p itemprop="description">…</p>
<p itemprop="http://example.com/voc/objective">…</p>
</div>
(Of course you can’t expect other consumers to make use of it.)
If you are using the Schema.org vocabulary, you could also:
propose new Schema.org properties/types
extend an existing Schema.org property (but it’s considered outdated)

Microdata markup with properties on multiple pages

I'm creating a web page and currently I'm adding Microdata markup to the code. I’m using schema.org’s MusicGroup.
I have an index.html page from where I'd like to take the name and the image properties for this band:
<div class="container" itemscope itemtype="http://schema.org/MusicGroup">
...
<img itemprop="image" src="img/logo.png" alt="logo" />
<p>We are <span itemprop="name">NAME OF THE BAND</span>.</p>
...
</div>
However on the about_us.html page there is a short description which I'd also like to use:
<div class="container" itemscope itemtype="http://schema.org/MusicGroup">
...
<p itemprop="description">A description of the band.</p>
...
</div>
When I use the code like this, search enginges (understandably) treat them as two different MusicGroups:
MusicGroup 1:
Image: .../img/logo.png
Name: NAME OF THE BAND
MusicGroup 2:
Description: A description of the band.
How can I link these properties into one item?
Microdata’s name-value pairs are per webpage, not per website.
So on a website about a music group, it can be expected that each page contains an "own" MusicGroup item, which is, however, actually always about the same music group. But from the Microdata or schema.org perspective, these different items would not be semantically connected that way (consumers might guess this however, e.g. by comparing property values).
Microdata’s itemid attribute could be used to uniquely identify each item. But it is required that the used vocabulary supports "global identifiers for items" (itemid is used for some types on schema.org (e.g., in the example for MedicalScholarlyArticle), but it’s not clear to me if it’s really supported as required by Microdata for other types, like MusicGroup).
So in your case, you could:
leave it as it is
duplicate the information, so that each item has all relevant content (possibly using meta/link elements)
move all information on one page (possibly using itemref)
(if it should be allowed for general use with schema.org) use itemid to state that several items are actually about the same thing

How to style Joomla 2.5 article's intro text?

It's very strange but I haven't found a really good solution by googling joomla style intro text.
I want that the current output:
<div class="item-content">
<p>Intro Text</p>
<p>Full Text</p>
</div>
to be replaced by:
<div class="item-content">
<div class="introtext"><p>Intro Text</p></div>
<div class="fulltext"><p>Full Text</p></div>
</div>
I was sure that Joomla itself should have declared such a class for introtext or at least should have a configurable option for that.
What I do NOT want:
A Joomla 1.x or Joomla 1.5 solution
A manual way until there is not
an extension-base solution (which is more more strange!)
UPDATE after {THIS} answer
Now I have a problem with $this->item->introtext, $this->item->fulltext and $this->item->text.
I expect $this->item->introtext to show ONLY introtext, but it also contains the contents AFTER READ MORE.
What property should I use to only include contents BEFORE READ MORE, not anything else?
I don't expect that the $this->item->introtext content be affected by Show Intro Text parameter in article options. It is expected that only $this->item->text cares about it. Am I right?
Note: $this->item->fulltext works as expected and outputs only the contents AFTER the READ MORE.
In case of disabling Show Intro Text parameter in article options, all of the 3 variables, return the text after READ MORE. This should really be considered as a bug.
It would be more wisely to have a variable to return only intro text (in any situation), a variable to return only full text (in any situation), and a variable to include/exclude introtext according to the article parameter: Show Intro Text
All you need to do is add a template override. You need to make a copy of this file:
/JOOMLA INSTALL/components/com_content/views/article/tmpl/default.php
Make any changes to the code that you want, then upload it here:
/JOOMLA INSTALL/templates/flexibility/html/com_content/article/default.php
Simple as that.
In Joomla 3.3.0 it just works as you expected:
<div id="introtext"><?php echo$this->item->introtext; ?></div>
<div id="fulltext"><?php echo $this->item->fulltext; ?></div>
(in templates/your_template_name/html/com_content/article/default.php)

Resources