Make sure the extra field "alias" is inserted exactly as stated in each line above (but without the quotes). Ticket Purchase URL ("link" type extra field and alias 'e_ticket_link') Ticket Price ("text" type extra field and alias 'e_ticket_price') End Date ("date" type extra field and alias 'e_end_date') Start Date ("date" type extra field and alias 'e_start_date') Location Country (with extra field alias 'e_loc_country') Location State/Province (with extra field alias 'e_loc_state') Location Postal Code (with extra field alias 'e_loc_pc') Location Town/City (with extra field alias 'e_loc_city') Location Address (with extra field alias 'e_loc_addr') Location Name (with extra field alias 'e_loc_name') you would need to add the following ("text" type) extra fields: "streetAddress": "100 West Snickerpark Dr", So for "location" and given that GSD guidelines reference this: "location": "Place", For any object element referenced, you'll have to create an extra field for each of its properties. The GSD properties "description" and "image" already come with default K2 GSD. According to the bare minimum for a GSD event type are "location" (object), "name" (we can use the K2 item's title here), "startDate" and optionally "endDate" and "offers" (object). Now create extra fields in K2 for each of the GSD data you wish to add. Make sure that the new "events" sub-template (created on step 1) as well as the "Events" extra fields group (created on step 2) are both selected.Ĥ. Create a K2 Category and also call it "Events". Create a new K2 Extra Fields Group and call it "Events".ģ. More info on overriding K2 templates can be found here: Ģ. If you want to override the category listing as well (for templating reasons), just copy all the files in /components/com_k2/templates/default/ into /templates/YOUR_TEMPLATE/html/com_k2/events/. Copy the file /components/com_k2/templates/default/item.php into /templates/YOUR_TEMPLATE/html/com_k2/events/ (create the additional folders after /templates/YOUR_TEMPLATE/html/). This will only override the item view. Create an override for item.php to apply our GSD code for event content types. This step will not be necessary once K2 v2.10.3 is officially released.ġ. Upgrade to K2 v2.10.3 (dev) from - this is required to be able to get the raw URL from a "link" type extra field. Here are the steps to do so for the "event" content type.Ġ. If you've done that step already, then extending K2's GSD output to support additional content types is not hard. Usually K2 integrators will create these as extra fields and display them to one or more K2 categories. However these additional content types require data to be output that are not standard in K2, e.g. In the K2 component's Settings you'll notice that 6 more content types are listed there for product, event, video, course, movie and recipe. However it does so for the most basic content types of GSD: article, news article & blog post K2 supports Google Structured Data (GSD) since version 2.10.x (in the item view).
0 Comments
Leave a Reply. |