- Getting Started
- Schema Types
- Integrations
- Developers
-
Troubleshooting
- Troubleshoot Structured Data not Generated on the Page
- Preview button not showing on Structured Data Testing Tool
- I am seeing the "is not a known valid target type for the identifier property" error
- Fixing Error decoding JSON data in Joomla Articles
- Fix missing Google Structured Data tab in the Article Editing Page
- Remove Faulty Microdata
- Troubleshoot Structured Data not Showing in Search Results
- Functionality
Developer - Extend Structured Data with Joomla Plugins
Heads up! This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
Customize and extend Google Structured Data extension with PHP code.
onGSDSchemaBeforeGenerate
This event fires immediately before the generation of the JSON-LD script that will be injected into the <head> of the page. It passes the $schema array variable by reference which includes all the schema properties. This is rather useful when you want to modify a schema property with a value fetched from the database or another extension.
Parameters
$schema | (array) The schema.org properties |
$data | (object) The structured data item as configured in the backend |
Source
administrator/components/com_gsd/GSD/Json.php
Syntax
public function onGSDSchemaBeforeGenerate(&$schema, $data)
{
$schema['myProperty'] = 'myValue';
}
Last updated on Nov 26th 2024 12:11
In This Article