1
\$\begingroup\$

I updated my code based on the feedback from my previous question. There is one for the home page and one for the product pages:

Home page code:

<div itemscope itemtype="http://schema.org/TravelAgency">
<span itemprop="name">NAME OF TRAVEL AGENCY</span>
<link itemprop="url" href="HOME PAGE URL">
<span itemprop="description">SHORT DESCRIPTION OF THE TRAVEL AGENCY</span>
</div>

Product page code:

<body itemscope itemtype="http://schema.org/MedicalWebPage">
    <link itemprop="author" href="http://schema.org/TravelAgency" />
    <link itemprop="url" href="HOME PAGE URL">

    <link itemprop="specialty" href="http://schema.org/PlasticSurgery" />
    <meta itemprop="aspect" content="treatment"/>

    <span itemprop="name">TITLE OF PAGE</span>
    <span itemprop="description">SHORT DESCRIPTION OF PAGE CONTENT</span>
    <img itemprop="image" src="NAME OF IMAGE ON THIS PAGE.jpg" alt="ALT NAME OF IMAGE"/>

    <span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
    The cost of 
    <span itemprop="itemOffered">NAME OF TREATMENT</span> 
    <span itemprop="alternateName">ALTERNATE NAME OF TREATMENT</span> is <span itemprop="priceCurrency" content="EUR">€</span><span itemprop="price" content="600.00">600.00</span>
    </span>
</body>
\$\endgroup\$
2
  • 4
    \$\begingroup\$ I'm confused by the question. Is this describing some travel agency that offers plastic surgery? \$\endgroup\$ Jan 20, 2015 at 7:33
  • \$\begingroup\$ @200_success It's both. the question was how to combine both categories. \$\endgroup\$
    – Julien
    Jan 22, 2015 at 7:01

1 Answer 1

1
\$\begingroup\$

Home page (TravelAgency)

Looks correct.

Note that you could (if you want) use this item on every page of your website, not only on the home page.

Typically, you could always use this item for marking up the header of each page. By using its url property, you always link back to the same URL (i.e., your home page’s URL), so consumers can understand that it’s always the same TravelAgency entity.

Product page (MedicalWebPage)

Your use of the properties specialty, aspect, name, description, and image is correct.

author property

The value of the author property needs to be the URL of the author, not the URL of the Schema.org type.

Schema.org expects an Organization/Person as value, so you could make this explicit by using:

<span itemprop="author" itemscope itemtype="http://schema.org/TravelAgency">
  <link itemprop="url" href="HOME PAGE URL" />
</span>

If you don’t want to use so "much" markup, you could also simply link directly:

<link itemprop="author" href="HOME PAGE URL" />

However, most sites have a link to the home page anyway (i.e., in the logo or the navigation), so you could reuse this link instead of duplicating it with link.

url property

The value of the url property would have to be the URL of this MedicalWebPage, not the URL of your homepage.

It doesn’t hurt to have it, but it isn’t really needed in the first place (as it’s just the URL of the current document anyway).

You could, if you want, combine this with a possible rel-canonical in your head.

offers property

Using the offers property on MedicalWebPage would mean that you are offering this web page (e.g., for sale), as its definition says (bold emphasis mine):

An offer to provide this item […]

This is probably not what you want to say, or is it?

Offer

itemOffered property

The itemOffered property expects a Product as value. This is not required (using text, like you do, is allowed), but if you want to go the extra mile, make it a Product item:

<span itemprop="itemOffered" itemscope itemtype="http://schema.org/Product">
  <span itemprop="name">NAME OF TREATMENT</span>
</span> 

span element can’t have a content attribute

In HTML5/Microdata, only the meta element can have a content attribute, so it’s not allowed on span.

Instead of <span itemprop="priceCurrency" content="EUR">€</span>, you might want to use:

<meta itemprop="priceCurrency" content="EUR">€

And instead of <span itemprop="price" content="600.00">600.00</span>:

<span itemprop="price">600.00</span>
\$\endgroup\$
6
  • \$\begingroup\$ Thx for great feedback! For Product Page: 1. I will use the TravelAgency code in the header of each page. In this case do I still need the author property? <link itemprop="author" href="HOME PAGE URL" /> 2. I will take out the url property altogether as it doesn't add useful information. 3. For Offer, yes it makes sense! \$\endgroup\$
    – Julien
    Jan 20, 2015 at 8:58
  • \$\begingroup\$ @Julien: 1. I think it would be useful. But then you could point the author property to this item (instead of linking to its URL). You may need the itemref attribute for this, depending on your markup. 2. I’d at least keep it inside TravelAgency (to link to the homepage of your travel agency site). \$\endgroup\$
    – unor
    Jan 20, 2015 at 14:51
  • \$\begingroup\$ I have tested the code in Google rich snippets tool. google.com/webmasters/tools/… It gives me an error for author. I read in the forum that the Google tool highlights error while recognising the property. Should I: 1. Pay attention to the error message? 2. Add the Organization category in the header above TravelAgency? 3. Use another property? I have tried agent but it gives me the same error message? 4. Use this code: <div itemscope itemtype="schema.org/TravelAgency" itemref="schema-organization"> \$\endgroup\$
    – Julien
    Jan 22, 2015 at 7:09
  • \$\begingroup\$ @Julien: I think the comments are the wrong place to answer these questions; you might want to create a new question on Stack Overflow for this. --- FWIW, Google has a new testing tool: developers.google.com/webmasters/structured-data/testing-tool \$\endgroup\$
    – unor
    Jan 22, 2015 at 12:48
  • 1
    \$\begingroup\$ I have created a new question in code check: codereview.stackexchange.com/questions/78537/… It combines several of your answers. Thanks for your help! \$\endgroup\$
    – Julien
    Jan 25, 2015 at 9:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.