I am currently doing the technical part of creating an Arabic version of our website. The other languages should not be affected by this, so basically the changes to the markup must be minimal.
What I have (in English):
<div class="location_description"> <span itemscope itemtype="http://schema.org/AdministrativeArea">
<span class="glyph featcl_T"></span>
<span itemprop="name">Canton of Obwalden</span>,</span>
<span class="coords" itemprop="geo" itemtype="http://schema.org/GeoCoordinates">46.77°N 8.43°E 3238m asl
<meta itemprop="elevation" content="3238">
<a target="_blank" title="Geonames" href="http://www.geonames.org/2658357"><span class="glyph edit">
</span>
</a>
<meta itemprop="latitude" content="46.77">
<meta itemprop="longitude" content="8.43">
</span>
</div>
"Canton of Obwalden" comes from a database, and can be Arabic too, but can also be in any other language.
Our translator did the translations for "N", "E" and "m asl", and the result is a total mess... http://jsfiddle.net/stby04/xzj5czb5/
So, how do I bring that in the correct order for every possible combination of languages?
add dir="rtl" in every tag in which you expect to have Right to Left Text
div class="arabic">
<div class="location_description"> <span dir="rtl" itemscope="" itemtype="http://schema.org/AdministrativeArea">
<span dir="rtl" class="glyph featcl_T"></span>
<span dir="rtl" class="arabic" itemprop="name">Kanton Obwalden</span>,</span> <span class="arabic" itemprop="geo" itemscope="" itemtype="http://schema.org/GeoCoordinates">46.77°ش 8.43°ق 3238متر فوق سطح البحر<meta itemprop="elevation" content="3238"><a target="_blank" title="Geonames" href="http://www.geonames.org/2658357"><span class="glyph edit"></span>
</a>
<meta itemprop="latitude" content="46.77">
<meta itemprop="longitude" content="8.43">
</span>
</div>
</div>
Related
I have many web elements like this
<a data-control-name="browsemap_profile" href="/in/quyen-nguyen-63098b123/" id="ember278" class="pv-browsemap-section__member ember-view"> <img width="56" src="https://media-exp1.licdn.com/dms/image/C5603AQFHZ41UPexTLQ/profile-displayphoto-shrink_100_100/0?e=1599091200&v=beta&t=lkoiKVK58W1tciUEc5UUohvEsa99lLTv66a1PJ4hp5k" loading="lazy" height="56" alt="member_name" id="ember279" class="lazy-image pv-browsemap-section__member-image EntityPhoto-circle-4 ember-view">
<div class="pv-browsemap-section__member-detail">
<h3 id="ember280" class="pv-browsemap-section__member-detail--has-hover actor-name-with-distance ember-view"> <span class="name-and-icon"><span class="name">Quyen Nguyen</span>
<span class="distance-and-badge">
<span data-test-distance-badge="" id="ember281" class="distance-badge separator ember-view"><span class="visually-hidden">
2nd degree connection
</span>
<span class="dist-value">2nd</span>
</span><!----> </span>
</span>
</h3>
<p class="pv-browsemap-section__member-headline t-14 t-black t-normal">
<div style="line-height:2rem;max-height:4rem;-webkit-line-clamp:2;" id="ember282" class="inline-show-more-text inline-show-more-text--is-collapsed inline-show-more-text--is-collapsed-with-line-clamp ember-view">I'm looking for IT Director/Admissions Director/Training Head/Marketing Director
<!---->
<!----></div>
</p>
</div>
</a>
I want to get a list of data like this /in/quyen-nguyen-63098b123/? How many way to select then get this data?
I also want to get a list of id in pattern: ember278, ember279 , ember238 , etc.
Use
IEnumerable<IWebElement> connectionBlocks = driver.FindElements(By.XPath("//a[#id[starts-with(., 'ember') and string-length() > 5]]"));
Then use regular expression for next parsing.
I have a product which has reduced price. I want to show both prices - original and discounted. Is there a way to mark this in Schema.org?
For now I have something similar:
<ul class="productPriceList" itemprop="offers" itemscope="" itemtype="http://schema.org/Offer">
<li class="productPriceList">
<div class="price red"><span class="" itemprop="price">4302</span> <span itemprop="priceCurrency" content="USD">$</span></div>
<span class="price crossOut" itemprop="price">26890</span> <span itemprop="priceCurrency" content="USD">$</span> <span class="product-promo">84</span>% off
</li>
</ul>
This shows as:
offers
#type: Offer
price: 4302
priceCurrency: USD
price: 26890
priceCurrency: USD
Your current markup doesn’t convey which price is the old/new one. You shouldn’t use that.
You could use two PriceSpecification items instead (as value for the priceSpecification property). With validFrom and validThrough you can specify the dates when the old price was valid and since when the new price is valid.
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<div itemprop="priceSpecification" itemscope itemtype="PriceSpecification">
<s>$ <span itemprop="price">26890</span></s>
<meta itemprop="priceCurrency" content="USD" />
<meta itemprop="validThrough" content="…" />
</div>
<div itemprop="priceSpecification" itemscope itemtype="PriceSpecification">
$ <span itemprop="price">4302</span>
<meta itemprop="priceCurrency" content="USD" />
<meta itemprop="validFrom" content="…" />
</div>
</div>
(Note that the span element can’t have a content attribute in Microdata. I replaced it with a meta element.)
I'm trying to do the right mikrodaty layout for the site. Do I understand how to act . For example I go to https://schema.org/Organization and go through the list to the bottom . Opt for each tag (name, adress, streetAddress and so on ) . If possible, I need to fill out all the tags , am I right?Now I got something like this:
<div itemscope itemtype="http://schema.org/Organization">
<div class="historyb" id="historyb">
<span class="historyh2" itemprop="name">MyName</span>
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">
Street & number of house
</span>
<span itemprop="addressLocality">City</span>,
<span itemprop="postalCode">111111</span>
</div>
<a href="mailto:MyEmail#gmail.com" itemprop="email">
MyEmail#gmail.com
</a>
<span itemprop="foundingDate">Date</span>
<span itemprop="foundingLocation">City</span>
<span itemprop="legalName">Full Name</span>
<a itemprop="url" href="#"><img itemprop="logo" src="http://www.mysite.ru/images/logo.png" /></a>
</div>
This is valid according to Google's test tool but you might want to include addressCountry and addressRegion for https://schema.org/Place
I'm using schema.org definition to represent a product.
I have a doubt about product size: should I specify the unit of measure in the field?
Here's my code (I need a separate span for "cm" to style it differently):
<div itemscope itemtype="http://schema.org/Product">
<h1 itemprop="name">Product name</h1>
Size:
<span itemprop="width">60 <span>cm</span></span>
<span itemprop="height">50 <span>cm</span></span>
<span itemprop="depth">40 <span>cm</span></span>
</div>
Is this the correct way to define the size?
The width/depth/height properties expect Distance or QuantitativeValue as value.
If you want to use Distance:
As the Distance type does not seem to define a suitable property to provide the actual value, and its description says that values have
[…] the form '<Number> <Length unit of measure>'. E.g., '7 ft'.
I assume that the type should not be provided explicitly, e.g.:
<span itemprop="width">
60 <span>cm</span>
</span>
If the type should be provided, I guess using name is the only option:
<span itemprop="width" itemscope itemtype="http://schema.org/Distance">
<span itemprop="name">60 <span>cm</span></span>
</span>
If you want to use QuantitativeValue:
<span itemprop="width" itemscope itemtype="http://schema.org/QuantitativeValue">
<span itemprop="value">60</span>
<span>cm</span>
<meta itemprop="unitCode" content="CMT" />
</span>
Instead of specifying the UN/CEFACT code for "cm" (= CMT) in a meta element (which is allowed in the body, if you use it for Microdata), you could also use the data element:
<span itemprop="width" itemscope itemtype="http://schema.org/QuantitativeValue">
<span itemprop="value">60</span>
<data itemprop="unitCode" value="CMT">cm</data>
</span>
I have the following problem. I have add the microdata schema to my page but I want hidden.
Anyone have an idea?
The code that I've use is the following:
<div itemscope itemtype="http://schema.org/LocalBusiness">
<a itemprop="url" href="http://www.example.net/"><div itemprop="name"><strong>Audiosky Mobile Development</strong></div>
</a>
<div itemprop="description">Description/div>
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="addressLocality">Los Angeles</span><br>
<span itemprop="addressRegion">California</span><br>
<span itemprop="postalCode"></span><br>
<span itemprop="addressCountry">USA</span><br>
</div>
</div>
If you want to hide your markup you may use meta tags.
Like in example from schema.org Getting Started page
<div itemscope itemtype="http://schema.org/Offer">
<span itemprop="name">Blend-O-Matic</span>
<span itemprop="price">$19.95</span>
<div itemprop="reviews" itemscope itemtype="http://schema.org/AggregateRating">
<img src="four-stars.jpg">
**<meta itemprop="ratingValue" content="4">**
**<meta itemprop="bestRating" content="5">**
Based on <span itemprop="ratingCount">25</span> user ratings
</div>
</div>
For invisible links use tag link like in example.
<div itemscope itemtype="http://schema.org/Offer">
<span itemprop="name">Blend-O-Matic</span>
<span itemprop="price">$19.95</span>
**<link itemprop="availability" href="http://schema.org/InStock">**Available today!
</div>
However don't overuse hidden text as Search Engines may judge it somewhat spammy. In your case I advise to put markup in address block at your main or contact page and hide only few tags.
better than css hide or meta & link tags, use JSON+LD
example from https://schema.org/LocalBusiness
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "LocalBusiness",
"address": {
"#type": "PostalAddress",
"addressLocality": "Mexico Beach",
"addressRegion": "FL",
"streetAddress": "3102 Highway 98"
},
"description": "A superb collection of fine gifts and clothing to accent your stay in Mexico Beach.",
"name": "Beachwalk Beachwear & Giftware",
"telephone": "850-648-4200"
}
</script>
You can also try this to hide it from user. It working fine for me.
<address style="display: none;">
<div itemscope itemtype="http://schema.org/Offer">
<span itemprop="name">Blend-O-Matic</span>
<span itemprop="price">$19.95</span>
<div itemprop="reviews" itemscope itemtype="http://schema.org/AggregateRating">
<img src="four-stars.jpg">
**<meta itemprop="ratingValue" content="4">**
**<meta itemprop="bestRating" content="5">**
Based on <span itemprop="ratingCount">25</span> user ratings
</div>
</div>
</address>