-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[6.2] Add LocalBusiness schema type plugin #47667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mortezahonar
wants to merge
36
commits into
joomla:6.2-dev
Choose a base branch
from
mortezahonar:6.2-dev
base: 6.2-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
7f86cd0
Create localbusiness.xml
mortezahonar 4348c34
Create schemaorg.xml
mortezahonar 0a47162
Create provider.php
mortezahonar 115b9ea
Create localbusiness.php
mortezahonar 8ed4a47
Create plg_schemaorg_localbusiness.ini
mortezahonar 489018a
Create plg_schemaorg_localbusiness.sys.ini
mortezahonar 1147226
Update plg_schemaorg_localbusiness.ini
mortezahonar b983d1b
Update schemaorg.xml
mortezahonar eec5f9b
Update provider.php
mortezahonar bf32e39
Update and rename localbusiness.php to Localbusiness.php
mortezahonar 7c99401
Update localbusiness.xml
mortezahonar a82be19
Update administrator/language/en-GB/plg_schemaorg_localbusiness.ini
mortezahonar e1b405f
Update administrator/language/en-GB/plg_schemaorg_localbusiness.sys.ini
mortezahonar 577b7dd
Update plugins/schemaorg/localbusiness/services/provider.php
mortezahonar fffe31d
Update plugins/schemaorg/localbusiness/services/provider.php
mortezahonar 6a23da0
Update plugins/schemaorg/localbusiness/src/Extension/Localbusiness.php
mortezahonar c98cd94
Update plugins/schemaorg/localbusiness/src/Extension/Localbusiness.php
mortezahonar 1055d67
Update plugins/schemaorg/localbusiness/src/Extension/Localbusiness.php
mortezahonar c62f405
Apply suggestions from code review
mortezahonar 5d87288
Update plugins/schemaorg/localbusiness/localbusiness.xml
mortezahonar ed2f6cf
Update plugins/schemaorg/localbusiness/localbusiness.xml
mortezahonar e8e591b
Apply suggestion from @brianteeman
mortezahonar 8022f01
Update schemaorg.xml ordering the field elements
mortezahonar 2a8fb34
Merge branch '6.2-dev' into 6.2-dev
mortezahonar a199543
Update schemaorg.xml
mortezahonar 8bc447c
Update plg_schemaorg_localbusiness.ini
mortezahonar 18a90d0
Update plg_schemaorg_localbusiness.ini
mortezahonar fb07657
Update base.sql
mortezahonar 4e9f46c
Update base.sql
mortezahonar c04ef7f
Update base.sql delet localbusiness
mortezahonar aa753c6
Update postgresql/base.sql
mortezahonar 696f9c9
Update ExtensionHelper.php
mortezahonar aeafc25
Update ExtensionHelper.php
mortezahonar 4a61aed
[6.2] Add localbusiness to ExtensionHelper.php
mortezahonar 55d4483
Update schemaorg.xml
mortezahonar f647858
Merge branch '6.2-dev' into 6.2-dev
mortezahonar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
administrator/language/en-GB/plg_schemaorg_localbusiness.ini
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| ; Joomla! Project | ||
| ; (C) 2026 Open Source Matters, Inc. <https://www.joomla.org> | ||
| ; License GNU General Public License version 2 or later; see LICENSE.txt | ||
| ; Note : All ini files need to be saved as UTF-8 | ||
|
|
||
| PLG_SCHEMAORG_LOCALBUSINESS="Schema.org - Localbusiness" | ||
| PLG_SCHEMAORG_LOCALBUSINESS_DESCRIPTION_LABEL="More information on the Schema.org Localbusiness Type can be found at <a href=\"https://schema.org/LocalBusiness\" target=\"_blank\" rel=\"noopener noreferrer\">https://schema.org/Localbusiness</a>" | ||
| PLG_SCHEMAORG_LOCALBUSINESS_FIELD_ADDRESS_LABEL="Address" | ||
| PLG_SCHEMAORG_LOCALBUSINESS_FIELD_EMAIL_LABEL="Email" | ||
| PLG_SCHEMAORG_LOCALBUSINESS_FIELD_GENERIC_FIELD_LABEL="Generic Field" | ||
| PLG_SCHEMAORG_LOCALBUSINESS_FIELD_GENERIC_TITLE_LABEL="Title" | ||
| PLG_SCHEMAORG_LOCALBUSINESS_FIELD_GENERIC_VALUE_LABEL="Value" | ||
| PLG_SCHEMAORG_LOCALBUSINESS_FIELD_LOCALITY_LABEL="Locality" | ||
| PLG_SCHEMAORG_LOCALBUSINESS_FIELD_LOGO_LABEL="Logo" | ||
| PLG_SCHEMAORG_LOCALBUSINESS_FIELD_NAME_LABEL="Name" | ||
| PLG_SCHEMAORG_LOCALBUSINESS_FIELD_POSTAL_CODE_LABEL="Postal Code" | ||
| PLG_SCHEMAORG_LOCALBUSINESS_FIELD_STREET_ADDRESS_LABEL="Street Address" | ||
| PLG_SCHEMAORG_LOCALBUSINESS_FIELD_TELEPHONE_LABEL="Telephone" | ||
| PLG_SCHEMAORG_LOCALBUSINESS_FIELD_URL_LABEL="URL" | ||
| PLG_SCHEMAORG_LOCALBUSINESS_XML_DESCRIPTION="Adds Localbusiness as a new schema type in existing schemas." | ||
7 changes: 7 additions & 0 deletions
7
administrator/language/en-GB/plg_schemaorg_localbusiness.sys.ini
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| ; Joomla! Project | ||
| ; (C) 2026 Open Source Matters, Inc. <https://www.joomla.org> | ||
| ; License GNU General Public License version 2 or later; see LICENSE.txt | ||
| ; Note : All ini files need to be saved as UTF-8 | ||
|
|
||
| PLG_SCHEMAORG_LOCALBUSINESS="Schema.org - Localbusiness" | ||
| PLG_SCHEMAORG_LOCALBUSINESS_XML_DESCRIPTION="Adds Localbusiness as a new schema type in existing schemas" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,130 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <form> | ||
| <fields name="schema"> | ||
| <fieldset | ||
| name="schema" | ||
| label="PLG_SYSTEM_SCHEMA_FIELD_SCHEMA_LABEL" | ||
| > | ||
| <field | ||
| name="Localbusiness" | ||
| type="subform" | ||
| showon="schemaType:Localbusiness" | ||
| > | ||
| <form> | ||
|
|
||
| <field | ||
|
mortezahonar marked this conversation as resolved.
|
||
| name="@type" | ||
| type="hidden" | ||
| default="Localbusiness" | ||
| /> | ||
|
|
||
| <field | ||
| name="noteBook" | ||
| type="note" | ||
| description="PLG_SCHEMAORG_LOCALBUSINESS_DESCRIPTION_LABEL" | ||
| class="alert alert-info w-100" | ||
| /> | ||
|
|
||
| <field | ||
| name="name" | ||
| type="text" | ||
| label="PLG_SCHEMAORG_LOCALBUSINESS_FIELD_NAME_LABEL" | ||
| filter="string" | ||
| /> | ||
|
|
||
| <field | ||
| name="image" | ||
| type="media" | ||
| label="PLG_SCHEMAORG_LOCALBUSINESS_FIELD_LOGO_LABEL" | ||
| schemes="http,https,ftp,ftps,data,file" | ||
| validate="url" | ||
| relative="true" | ||
| /> | ||
|
|
||
| <field | ||
| name="url" | ||
| type="url" | ||
| label="PLG_SCHEMAORG_LOCALBUSINESS_FIELD_URL_LABEL" | ||
| filter="url" | ||
| validate="url" | ||
| /> | ||
|
|
||
| <field | ||
| name="email" | ||
| type="email" | ||
| label="PLG_SCHEMAORG_LOCALBUSINESS_FIELD_EMAIL_LABEL" | ||
| validate="email" | ||
| /> | ||
|
|
||
| <field | ||
| name="telephone" | ||
| type="text" | ||
| label="PLG_SCHEMAORG_LOCALBUSINESS_FIELD_TELEPHONE_LABEL" | ||
| filter="string" | ||
| /> | ||
|
|
||
| <field | ||
| name="address" | ||
| type="subform" | ||
| label="PLG_SCHEMAORG_LOCALBUSINESS_FIELD_ADDRESS_LABEL" | ||
| > | ||
| <form> | ||
|
|
||
| <field | ||
| name="@type" | ||
| type="hidden" | ||
| default="PostalAddress" | ||
| /> | ||
|
|
||
| <field | ||
| name="addressLocality" | ||
| type="text" | ||
| label="PLG_SCHEMAORG_LOCALBUSINESS_FIELD_LOCALITY_LABEL" | ||
| /> | ||
|
|
||
| <field | ||
| name="postalCode" | ||
| type="text" | ||
| label="PLG_SCHEMAORG_LOCALBUSINESS_FIELD_POSTAL_CODE_LABEL" | ||
| /> | ||
|
|
||
| <field | ||
| name="streetAddress" | ||
| type="text" | ||
| label="PLG_SCHEMAORG_LOCALBUSINESS_FIELD_STREET_ADDRESS_LABEL" | ||
| /> | ||
|
|
||
| </form> | ||
| </field> | ||
|
|
||
| <field | ||
| name="genericField" | ||
| type="subform" | ||
| label="PLG_SCHEMAORG_LOCALBUSINESS_FIELD_GENERIC_FIELD_LABEL" | ||
| multiple="true" | ||
| > | ||
| <form> | ||
| <field | ||
| name="genericTitle" | ||
| type="text" | ||
| label="PLG_SCHEMAORG_LOCALBUSINESS_FIELD_GENERIC_TITLE_LABEL" | ||
| filter="string" | ||
| size="30" | ||
| /> | ||
| <field | ||
| name="genericValue" | ||
| type="text" | ||
| label="PLG_SCHEMAORG_LOCALBUSINESS_FIELD_GENERIC_VALUE_LABEL" | ||
| filter="string" | ||
| size="30" | ||
| /> | ||
|
|
||
| </form> | ||
|
|
||
| </field> | ||
|
|
||
| </form> | ||
| </field> | ||
| </fieldset> | ||
| </fields> | ||
| </form> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <extension type="plugin" group="schemaorg" method="upgrade"> | ||
| <name>plg_schemaorg_localbusiness</name> | ||
| <author>Joomla! Project</author> | ||
| <creationDate>2026-04</creationDate> | ||
| <copyright>(C) 2026 Open Source Matters, Inc.</copyright> | ||
| <license>GNU General Public License version 2 or later; see LICENSE.txt</license> | ||
| <authorEmail>admin@joomla.org</authorEmail> | ||
| <authorUrl>www.joomla.org</authorUrl> | ||
| <version>__DEPLOY_VERSION__</version> | ||
| <description>PLG_SCHEMAORG_LOCALBUSINESS_XML_DESCRIPTION</description> | ||
| <namespace path="src">Joomla\Plugin\Schemaorg\Localbusiness</namespace> | ||
| <files> | ||
| <folder plugin="localbusiness">services</folder> | ||
| <folder>src</folder> | ||
| </files> | ||
| <languages> | ||
| <language tag="en-GB">language/en-GB/plg_schemaorg_localbusiness.ini</language> | ||
| <language tag="en-GB">language/en-GB/plg_schemaorg_localbusiness.sys.ini</language> | ||
| </languages> | ||
| <config> | ||
| <fields name="params"> | ||
| <fieldset name="basic"> | ||
| <field | ||
| name="allowedlist" | ||
| type="SchemaorgComponentSections" | ||
| label="JSCHEMAORG_EXTENSION_ALLOWED_LABEL" | ||
| description="JSCHEMAORG_EXTENSION_ALLOWED_DESCRIPTION" | ||
| multiple="multiple" | ||
| layout="joomla.form.field.list-fancy-select" | ||
| /> | ||
| <field | ||
| name="forbiddenlist" | ||
| type="SchemaorgComponentSections" | ||
| label="JSCHEMAORG_EXTENSION_FORBIDDEN_LABEL" | ||
| description="JSCHEMAORG_EXTENSION_FORBIDDEN_DESCRIPTION" | ||
| multiple="multiple" | ||
| layout="joomla.form.field.list-fancy-select" | ||
| /> | ||
| </fieldset> | ||
| </fields> | ||
| </config> | ||
| </extension> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| <?php | ||
|
|
||
| /** | ||
| * @package Joomla.Plugin | ||
| * @subpackage Schemaorg.localbusiness | ||
| * | ||
| * @copyright (C) 2026 Open Source Matters, Inc. <https://www.joomla.org> | ||
| * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
| */ | ||
|
|
||
| \defined('_JEXEC') or die; | ||
|
|
||
| use Joomla\CMS\Extension\PluginInterface; | ||
| use Joomla\CMS\Factory; | ||
| use Joomla\CMS\Plugin\PluginHelper; | ||
| use Joomla\DI\Container; | ||
| use Joomla\DI\ServiceProviderInterface; | ||
| use Joomla\Plugin\Schemaorg\Localbusiness\Extension\Localbusiness; | ||
|
|
||
| return new class () implements ServiceProviderInterface { | ||
| /** | ||
| * Registers the service provider with a DI container. | ||
| * | ||
| * @param Container $container The DI container. | ||
| * | ||
| * @return void | ||
| * | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| public function register(Container $container) | ||
| { | ||
| $container->set( | ||
| PluginInterface::class, | ||
| function (Container $container) { | ||
| $plugin = new Localbusiness( | ||
| (array) PluginHelper::getPlugin('schemaorg', 'localbusiness') | ||
| ); | ||
| $plugin->setApplication(Factory::getApplication()); | ||
|
|
||
| return $plugin; | ||
| } | ||
| ); | ||
| } | ||
| }; |
45 changes: 45 additions & 0 deletions
45
plugins/schemaorg/localbusiness/src/Extension/Localbusiness.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| <?php | ||
|
|
||
| /** | ||
| * @package Joomla.Plugin | ||
| * @subpackage Schemaorg.localbusiness | ||
| * | ||
| * @copyright (C) 2026 Open Source Matters, Inc. <https://www.joomla.org> | ||
| * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
| */ | ||
|
|
||
| namespace Joomla\Plugin\Schemaorg\Localbusiness\Extension; | ||
|
|
||
| use Joomla\CMS\Plugin\CMSPlugin; | ||
| use Joomla\CMS\Schemaorg\SchemaorgPluginTrait; | ||
| use Joomla\Event\SubscriberInterface; | ||
|
|
||
| // phpcs:disable PSR1.Files.SideEffects | ||
| \defined('_JEXEC') or die; | ||
| // phpcs:enable PSR1.Files.SideEffects | ||
|
|
||
| /** | ||
| * Schemaorg Plugin | ||
| * | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| final class Localbusiness extends CMSPlugin implements SubscriberInterface | ||
| { | ||
| use SchemaorgPluginTrait; | ||
|
|
||
| /** | ||
| * Load the language file on instantiation. | ||
| * | ||
| * @var boolean | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| protected $autoloadLanguage = true; | ||
|
|
||
| /** | ||
| * The name of the schema form | ||
| * | ||
| * @var string | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| protected $pluginName = 'Localbusiness'; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.