Support » Plugin: Events Manager » Schema.org compatibility

Viewing 12 replies - 1 through 12 (of 12 total)
  • Schema doesn’t offer Events.

    You could try Rich Snippets, but I decided to not use any plugin at all for the events. It’s much better to use the microdata format in the Events Page settings. Because then you can use the conditional placeholders ({has_bookings} of {fully_booked}).

    This is what I use currently on the single event page formatting:

    <h2 class="sub-title">– Guided Tour with #_CONTACTNAME on #_ccEventDateLong –</h2>
    <div class="top-snippet">[RICH_REVIEWS_SNIPPET category="Guide Patrick"]</div>
    <div class="tEvent">
    	<div class="tEventLeft">
    	<table class="fixed300">
    		<tr><td>City Tour:</td><td>#_EVENTNAME</td></tr>
    		<tr><td>Date:</td><td>#_ccEventDateMediumExtra</td></tr>
    		<tr><td>Start:</td><td>From #_EVENTTIMES o'clock</td></tr>
    		<tr><td>Type:</td><td><span class="flag">#_ccCategoryImage</span> #_ccEventCategory</td></tr>
    		{no_bookings}<tr>
    	<td>Costs:</td>
    	<td><span itemprop="offers" itemscope itemtype="https://schema.org/Offer">
    	<span itemprop="availability" content="https://schema.org/PreOrder"></span>
    	<span itemprop="price" content="0.00"><a href="/groups/" title="Request a Private Tour.">On request</a>.</span>
    	<span itemprop="priceCurrency" content="EUR" /></span>
    	<span itemprop="url" content="#_EVENTURL"></span>
    	<span itemprop="description" content="#_ccEventCategory"></span></span></td>
    {/no_bookings}
    {has_bookings}<tr>
    	<td>Costs:</td>
    	<td><span itemprop="offers" itemscope itemtype="https://schema.org/Offer">
    			{bookings_open}
    				<span itemprop="availability" content="https://schema.org/InStock"></span>
    				<span itemprop="price" content="#_ccTicketPrice">#_EVENTPRICERANGE p.p.</span>	
    				<span itemprop="priceCurrency" content="EUR" /></span>
    			{/bookings_open}
    			{bookings_closed}
    				<span itemprop="availability" content="https://schema.org/SoldOut"></span>
    				<span itemprop="price" content="#_ccTicketPrice"></span>
    				<span itemprop="priceCurrency" content="EUR" /></span>
    					{fully_booked}SOLD OUT{/fully_booked}						
    					{has_spaces}€ #_ccTicketPrice p.p. {/has_spaces}
    			{/bookings_closed}
     <span itemprop="url" content="#_EVENTURL"></span>
     <span itemprop="description" content="#_ccTicketName"></span></span></td>
    </tr><tr>
    	<td>Status:</td>
    	<td>
    		{bookings_open}#_ccTicketsOpen{/bookings_open}
    		{bookings_closed}
    			{has_attendees}
    			#_BOOKEDSPACES participants.<br>
    			{/has_attendees}
    		<i class="fa fa-exclamation-triangle red" aria-hidden="true"></i> Bookings are closed.<br>Please <a href="/contact/">contact</a> me to book.
    		{/bookings_closed}
    	</td>
    </tr>{/has_bookings}
    {has_location}<tr>
    	<td colspan="2">Location:</td>
    </tr><tr>
    	<td class="alignright"><span class="sterretje-map"><i class="fa fa-map-marker fa-lg"></i></span></td>
    	<td>
    	<span class="sterretje-map" itemprop="location" itemscope itemtype="https://schema.org/PostalAddress">
        	<span itemprop="name"><strong>#_LOCATIONNAME</strong></span><br/>
        	<span itemprop="streetAddress">#_LOCATIONADDRESS</span><br>
        	<span itemprop="postalCode">#_LOCATIONPOSTCODE </span> <span itemprop="addressLocality">#_LOCATIONTOWN<br />
        	<meta itemprop="image" content="#_LOCATIONIMAGEURL"> </span>
        	<a href="#_LATT{mapit}" title="View on Google Maps" target="_blank">+ Google Maps</a>
        </span></td>
    </tr><tr>
    	<td colspan="2"><br>#_LOCATIONMAP<br><hr>
    </tr>{/has_location}
    {no_location}
    	<div class="offers"><span itemprop="location" itemscope itemtype="https://schema.org/PostalAddress">
        <meta itemprop="name" content="Stonehenge Creations">
        <meta itemprop="streetAddress" content="Franklinstraat 155">
        <meta itemprop="postalCode" content="2562 CD"> <meta itemprop="addressLocality" content="The Hague">
        </span></div>
    {/no_location}
    </table>
    	</table>
    	</div>
    	<div class="tEventRight">
    [tagged corner="
    		{has_bookings}
    			{bookings_open}Only #_AVAILABLESPACES tickets left{/bookings_open}
    			{bookings_closed}
    					{fully_booked}SOLD OUT{/fully_booked}						
    					{has_spaces}#_ccCategoryName{/has_spaces}
    			{/bookings_closed}
    			{/has_bookings}
    		{no_bookings}#_ccCategoryName{/no_bookings}"]
    #_ccEventCategory: "#_EVENTNAME"[/tagged]
    <br>
    #_EVENTNOTES
    <br style="clear:both" />
    {has_bookings}
    <br style="clear:both" />
    Patrick has an enormous passion for The Hague and its history. His enthusiasm and lively way of storytelling will make his juicy and sometimes even gruesome stories come back to life. As if you were right there when they happend...<br>
    <br>
    <strong>In short: <br><span class="green">When you  participate in a city walk with guide Patrick you will discover The Hague at its juiciest!</span></strong> <br>
     <br>
    {bookings_open}
     <br>
    <h3>Where & when?</h3>
    <img src="https://www.guidepatrick.nl/wp-content/uploads/sites/2/avond-aawijzen-200x182.jpg" alt="Evening tour with Guide Patrick." width="200" height="182" class="alignright size-medium wp-image-1946 shadow" />
    <ul class="fa-ul">
    <li><i class="fa-li fa fa-calendar fa-fw"></i>#_ccEventDateLongExtra at #_12HSTARTTIME</li>
    <li><i class="fa-li fa fa-clock-o fa-fw"></i>90 to 120 minutes</li>
    <li><i class="fa-li fa fa-money fa-fw"></i>€ #_ccTicketPrice p.p.</li>
    <li><i class="fa-li fa fa-map-marker fa-fw"></i>#_LOCATIONNAME in #_LOCATIONTOWN</li>
    <li><i class="fa-li fa fa-wheelchair fa-fw"></i>Fully wheelchair accessible</li>
    <li><i class="fa-li fa fa-paw fa-fw"></i>Even your dog is allowed with!</li>
    <li><i class="fa-li fa fa-fire fa-fw"></i>Smoking allowed (we're outside)</li>
    <li><i class="fa-li fa fa-umbrella fa-fw"></i>Will also take place in bad weather</li>
    </ul>
    <br>
    <hr>
    <h2 class="bookingform green">Book Your Ticket(s)</h2>{/bookings_open}
    #_BOOKINGFORM
    <br>
    {/has_bookings}
    	</div>
    </div>
    <div class="offers" itemscope itemtype="https://schema.org/Event">
    	<meta itemprop="eventStatus" content="EventScheduled">
    	<meta itemprop="typicalAgeRange" content="16+">
    	<meta itemprop="url" content="#_EVENTURL">
    	<meta itemprop="name" content="#_EVENTNAME op #_ccEventDate">
    	<meta itemprop="startDate" content="#_{Y-m-d\T}:#_24HSTARTTIME">
    	<meta itemprop="endDate" content="#_{Y-m-d\T}#_24HENDTIME">
    {no_bookings}
    <span itemprop="offers" itemscope itemtype="https://schema.org/Offer">
    	<span itemprop="availability" content="https://schema.org/PreOrder"></span>
    	<span itemprop="price" content="0.00"></span>
    	<span itemprop="priceCurrency" content="EUR" /></span>
    	<span itemprop="url" content="#_EVENTURL"></span>
    	<span itemprop="description" content="#_ccEventCategory"></span>
    </span>
    {/no_bookings}
    {has_bookings}
    	<span itemprop="offers" itemscope itemtype="https://schema.org/Offer">
    	{bookings_open}
    		<span itemprop="availability" content="https://schema.org/InStock"></span>
    		<span itemprop="price" content="#_ccTicketPrice"></span>	
    		<span itemprop="priceCurrency" content="EUR" /></span>
    	{/bookings_open}
    	{bookings_closed}
    		<span itemprop="availability" content="https://schema.org/SoldOut"></span>
    		<span itemprop="price" content="#_ccTicketPrice"></span>
    		<span itemprop="priceCurrency" content="EUR" /></span>
    	{/bookings_closed}
    <span itemprop="url" content="#_EVENTURL"></span>
    <span itemprop="description" content="#_ccTicketName"></span>
    </span>
    {/has_bookings}
    {has_location}
    	<span class="sterretje-map" itemprop="location" itemscope itemtype="https://schema.org/PostalAddress">
        	<span itemprop="name" content="#_LOCATIONTOWN"></span>
        	<span itemprop="streetAddress" content="#_LOCATIONADDRESS"></span>
        	<span itemprop="postalCode" content="#_LOCATIONPOSTCODE"></span> <span itemprop="addressLocality" content="#_LOCATIONTOWN"></span>
        	<meta itemprop="image" content="#_LOCATIONIMAGEURL">
        </span>
    {/has_location}
    {no_location}
    	<div class="offers"><span itemprop="location" itemscope itemtype="https://schema.org/PostalAddress">
        <meta itemprop="name" content="Stonehenge Creations">
        <meta itemprop="streetAddress" content="Franklinstraat 155">
        <meta itemprop="postalCode" content="2562 CD"> <meta itemprop="addressLocality" content="Den Haag">
        </span></div>
    {/no_location}
    </table>
    {has_bookings}
    <meta itemprop="description" content='#_ccEventDescription'>
    {/has_bookings}
    {no_bookings}
    <meta itemprop="description" content='#_EVENTNAME met #_ccBlogName in #_LOCATIONTOWN on #_{l j F Y}. This is a #_ccBlogCategory.'>
    {/no_bookings}
    <meta itemprop="image" content="#_EVENTIMAGEURL">
    <span class="offers" itemprop="performer" itemscope="" itemtype="https://schema.org/Person">
    	<span itemprop="name">#_CONTACTNAME</span>
    	<meta itemprop="sameAs" content="#_ccFacebook">
    	<meta itemprop="sameAs" content="#_ccTwitter">
    	<meta itemprop="sameAs" content="#_ccGooglePlus">
    	<meta itemprop="image" content="#_ccLogo">	
    </span>
    </div>

    Note: there are a lot of custom placeholders included which I created myself, but it does give you a great starter. 😉

    To see the live result, visit: https://www.guidepatrick.nl/agenda (and choose an event).

    Ambyomoron

    (@josiah-s-carberry)

    Maybe that plugin doesn’t support events, but schema.org surely does: https://schema.org/Event

    There are plenty of plugins that do support the event type.

    Found it’s much better to not use a plugin for the event markup. Just use the microdata format as it gives you the flexibility of conditional placeholders 😉

    See the source of https://www.gidspatrick.nl/agenda/stadswandeling-2017-08-25/

    @duisterdenhaag I have decided to use microdata too… failed to find a plugin to get me better json-ld. At least for events in Events manager because for products it’s fine.

    Indeed! I share your opinion. 😉
    If you need help with custom placeholders, let me know.

    For example: Schema.org needs the ticket price without the currency symbol, so I’ve created this one.

        // Create #_ccTicketPrice Placeholder = Ticket Price without currency symbol
        add_filter('em_event_output_placeholder', 'cc_output_ticket_price',1,3);
        function cc_output_ticket_price($replacement, $EM_Event, $result) {
        if ($result == '#_ccTicketPrice') {
        	global $EM_Event, $EM_Ticket;
        	foreach( $EM_Event->get_tickets()->tickets as $EM_Ticket ) {
        	}
        	$replacement = number_format($EM_Ticket->get_price(), 2, '.', '');
        }
        return $replacement;
        }

    I do have one issue here… I don’t know why but all my dates are displaying this.

    validFrom
    2017-01-01T00:00:00

    Minus the valid part of cos, is there a way around it. am using the same format you used in your code. [#_{Y-m-d\T}:#_24HSTARTTIME]

    Where are you placing the code? In Dashboard -> Events -> Settings -> Formatting -> Single Event Page?

    yes that is where i am placing the code.. but all dates are the same.. start and end

    Are you using the [ ? Because those need to be ”
    content=”#_{Y-m-d\T}:#_24HSTARTTIME” should work…

    i am not using [] i only put them there to show start and end of code. i will try to solve the issue and inform you.

    Also check your ticket cut off date. I noticed when creating new recurring events, it put all my cut off dates on 01-01-2017 00:00 instead of 1 hour before each event.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Schema.org compatibility’ is closed to new replies.