Forum Moderators: Robert Charlton & goodroi
<a name="20171209"></a>
<div itemscope itemtype="http://schema.org/Event" style="padding-bottom: 15px; margin-bottom: 15px; border-bottom: 1px solid #E5E5E5">
<p class="p_2"><b itemprop="name">[Event Name]</b></p>
<div class="p_2 small"><i itemprop="startDate" content="2017-12-09">Saturday, Dec 9</i></div>
<div class="p_2 small" itemprop="description">
[Event Description]
<a href="https://www.example.com/events/[event-name]/17150/" style="color:#8080FF">click for more info</a>
</div>
<div class="p_2 small">
<i itemprop="location" itemscope itemtype="http://schema.org/Place">
Location: <span itemprop="name">[Event Location]</span>
</i>
</div>
</div>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Event",
"name": "Example Event",
"startDate": "2017-12-09",
"location": {
"@type": "Place",
"address": {
"@type": "PostalAddress",
"streetAddress": "123 West Blvd.",
"addressLocality": "Example City",
"postalCode": "12320",
"addressRegion": "EX",
"addressCountry": "United States"
}
},
"description": "This event is an example",
}
</script>
Looks like you need to include an address as well
<div style="display: none" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="addressLocality">City</span>,
<span itemprop="addressRegion">ST</span>
</div> Worth noting that we also have a current thread that's discussing the misuse of event markup...
Can it be hidden? Eg:
<i itemprop="location" itemscope itemtype="http://schema.org/Place">
Location: <span itemprop="name">[Event Location]</span>
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<meta itemprop="addressLocality" content="[City]">
<span itemprop="addressRegion" content="[ST]">
</div>
</i> JavaScript notation embedded in a <script> tag in the page head or body
<link type="application/ld+json" rel="alternate" href="https://www.example.com/jsonld.js"> <script type="text/javascript" src="https://www.example.com/jsonld.jsonld"></script> <script type="text/javascript" src="https://www.example.com/jsonld.php?source=[link to whatever page is being viewed]"></script>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Event",
"name": "Example Event",
"startDate": "2017-12-09",
"location": {
"@type": "Place",
"address": {
"@type": "PostalAddress",
"streetAddress": "123 West Blvd.",
"addressLocality": "Example City",
"postalCode": "12320",
"addressRegion": "EX",
"addressCountry": "United States"
}
},
"description": "This event is an example",
}
</script>