Jump to content

Basic Schema Adjustment Plugin


coert_g

Recommended Posts

We're looking for a small project to be completed with the schema data problems that are currently happening with structured data on IPB. Currently all pages are set to have the schema type "Article", which doesn't allow for review averages etc to be pulled through to Google.

We're looking to have something written that checks which pages database is being used, and then changes the markup "Type" depending on the database. For instance, we have 'localBusiness' type pages, 'Product' pages and then Article pages. And we'd like the schema to reflect this.

If one goes to the Skydiving Gear page, we'd like those records to then be @type: Product and not @type: Article.

We've been speaking to the guys at IPB and while they say they are looking at potentially fixing this in future, it is rather urgent for us and we'd like to get a temporary fix so long.

Here's what we were told from staff, to assist any interested developer in gauging scope:

 

Quote

The JSON-LD markup is created and structured in backend PHP files, not in templates. You would need to create a plugin (or have one created for you) that overloads \IPS\cms\modules\front\database\record::manage(). I have done this before so I can confirm that it works. If you look at applications/cms/modules/front/database/record.php you'll find this code:
 


  \IPS\Output::i()->jsonLd['article']    = array(
      '@context'  => "http://schema.org",
      '@type'      => "Article",

By overloading the manage() method, calling parent::manage(), you can then override these values that have been set.

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...