Skip to content

[6.2] Add LocalBusiness schema type plugin#47667

Open
mortezahonar wants to merge 32 commits intojoomla:6.2-devfrom
mortezahonar:6.2-dev
Open

[6.2] Add LocalBusiness schema type plugin#47667
mortezahonar wants to merge 32 commits intojoomla:6.2-devfrom
mortezahonar:6.2-dev

Conversation

@mortezahonar
Copy link
Copy Markdown

@mortezahonar mortezahonar commented Apr 23, 2026

Pull Request resolves #

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

This PR adds a new schema.org plugin for LocalBusiness type.

  • Copy of organization plugin with modifications
  • Adds LocalBusiness schema type to the schema.org plugin system
  • Includes form fields: name, image, url, email, address, and generic fields
  • Implements SubscriberInterface and uses SchemaorgPluginTrait

Testing Instructions

  1. Install the plugin by copying the localbusiness folder to /plugins/schemaorg/ or install via zip.
  2. Enable the plugin from Extensions → Plugins (plg_schemaorg_localbusiness).
  3. Go to System → Clear Cache.
  4. Create or edit an article.
  5. In the Schema tab, select LocalBusiness from the schema type dropdown.
  6. Fill in the fields (Business Name, URL, Email, Address, etc.).
  7. Save the article.
  8. View the article on the frontend.
  9. Check the page source (Ctrl+U) and verify that a <script type="application/ld+json"> tag with @type: "LocalBusiness" is present.

Actual result BEFORE applying this Pull Request

  • LocalBusiness schema type is not available in the schema type dropdown.
  • Cannot add LocalBusiness structured data to articles.

Expected result AFTER applying this Pull Request

  • LocalBusiness schema type appears in the schema type dropdown.
  • Form fields (Business Name, URL, Email, Address, Additional Fields) are displayed.
  • Data is saved to the database and displayed as JSON-LD in the frontend with @type: "LocalBusiness".

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators PR-6.2-dev labels Apr 23, 2026
Comment thread administrator/language/en-GB/plg_schemaorg_localbusiness.ini Outdated
Comment thread administrator/language/en-GB/plg_schemaorg_localbusiness.sys.ini Outdated
Comment thread plugins/schemaorg/localbusiness/forms/schemaorg.xml
Comment thread plugins/schemaorg/localbusiness/services/provider.php Outdated
Comment thread plugins/schemaorg/localbusiness/services/provider.php Outdated
Comment thread plugins/schemaorg/localbusiness/src/Extension/Localbusiness.php Outdated
Comment thread plugins/schemaorg/localbusiness/src/Extension/Localbusiness.php Outdated
Comment thread plugins/schemaorg/localbusiness/src/Extension/Localbusiness.php Outdated
Comment thread plugins/schemaorg/localbusiness/src/Extension/Localbusiness.php Outdated
Comment thread plugins/schemaorg/localbusiness/localbusiness.xml Outdated
Comment thread plugins/schemaorg/localbusiness/localbusiness.xml Outdated
Comment thread plugins/schemaorg/localbusiness/localbusiness.xml Outdated
mortezahonar and others added 5 commits April 23, 2026 22:10
Co-authored-by: Brian Teeman <brian@teeman.net>
Co-authored-by: Brian Teeman <brian@teeman.net>
Co-authored-by: Brian Teeman <brian@teeman.net>
Co-authored-by: Brian Teeman <brian@teeman.net>
mortezahonar and others added 7 commits April 23, 2026 22:14
Co-authored-by: Brian Teeman <brian@teeman.net>
Co-authored-by: Brian Teeman <brian@teeman.net>
Co-authored-by: Brian Teeman <brian@teeman.net>
Co-authored-by: Brian Teeman <brian@teeman.net>
Co-authored-by: Brian Teeman <brian@teeman.net>
@mortezahonar mortezahonar deleted the branch joomla:6.2-dev April 26, 2026 17:44
@mortezahonar mortezahonar deleted the 6.2-dev branch April 26, 2026 17:44
@mortezahonar mortezahonar restored the 6.2-dev branch April 26, 2026 17:59
@mortezahonar mortezahonar reopened this Apr 26, 2026
@mortezahonar
Copy link
Copy Markdown
Author

Sorry, I wanted to change my branch name, which caused the PR to close. I have reopened it, and I won't change the branch name until this PR is reviewed. Sorry for adding a few unnecessary commits.

Added telephone property to LocalBusiness schema
Added language string for telephone property in LocalBusiness
@exlemor
Copy link
Copy Markdown

exlemor commented Apr 30, 2026

Hi @mortezahonar - thank you for this PR, potentially great addition to Joomla. You mention:

Install the plugin by copying the localbusiness folder to /plugins/schemaorg/ or install via zip.

I could not find a zip file or a localbusiness folder that you are referring to. Could you please provide that attachment and update the TESTING INSTRUCTIONS? thank you so much.

@mortezahonar
Copy link
Copy Markdown
Author

mortezahonar commented May 1, 2026

Thanks, Emmanuel. Yes, unfortunately the file hasn't been uploaded.
I'll put the download link but please let me know if the link is accessible to you or not.

https://cdn.imgurl.ir/uploads/l25406_localbusiness.zip

@YadakGostar
Copy link
Copy Markdown

I have tested this item ✅ successfully

Comment thread administrator/language/en-GB/plg_schemaorg_localbusiness.ini
@brianteeman
Copy link
Copy Markdown
Contributor

This pr needs to have sql changes in the installation sql so that the plugin is avilable on new installs and update sql for updated sites

Sorted language strings alphabetically in plg_schemaorg_localbusiness
[6.2] Added plg_schemaorg_localbusiness to installation SQL in alphabetical order
[6.2] Added plg_schemaorg_localbusiness to installation
[6.2] Update postgresql/base.sql for LocalBusiness plugin
@mortezahonar
Copy link
Copy Markdown
Author

mortezahonar commented May 2, 2026

This pr needs to have sql changes in the installation sql so that the plugin is avilable on new installs and update sql for updated sites
@brianteeman
Are the mysql/base.sql and postgresql/base.sql files what you meant?

@mortezahonar
Copy link
Copy Markdown
Author

mortezahonar commented May 3, 2026

Hi @mortezahonar - thank you for this PR, potentially great addition to Joomla. You mention:

Install the plugin by copying the localbusiness folder to /plugins/schemaorg/ or install via zip.

I could not find a zip file or a localbusiness folder that you are referring to. Could you please provide that attachment and update the TESTING INSTRUCTIONS? thank you so much.

@exlemor

Testing Instructions

Prerequisite:
Download the latest Joomla 6.2 Nightly Build from developer.joomla.org/nightly-builds.html


Step 1: Add Language Files

Download the following two language files from mortezahonar/joomla-cms:

  • administrator/language/en-GB/plg_schemaorg_localbusiness.ini
  • administrator/language/en-GB/plg_schemaorg_localbusiness.sys.ini

Copy both files to the same path on your Joomla installation:
administrator/language/en-GB/


Step 2: Modify Database Installation Files

Edit the following SQL files inside your nightly build package:

  • installation/sql/mysql/base.sql
  • installation/sql/postgresql/base.sql

Find this section:

(0, 'plg_schemaorg_organization', 'plugin', 'organization', 'schemaorg', 0, 1, 1, 0, 1, '', '{}', '', 6, 0),
(0, 'plg_schemaorg_person', 'plugin', 'person', 'schemaorg', 0, 1, 1, 0, 1, '', '{}', '', 7, 0),
(0, 'plg_schemaorg_recipe', 'plugin', 'recipe', 'schemaorg', 0, 1, 1, 0, 1, '', '{}', '', 8, 0),
(0, 'plg_schemaorg_custom', 'plugin', 'custom', 'schemaorg', 0, 1, 1, 0, 1, '', '{}', '', 9, 0),

Replace with:

(0, 'plg_schemaorg_localbusiness', 'plugin', 'localbusiness', 'schemaorg', 0, 1, 1, 0, 1, '', '{}', '', 6, 0),
(0, 'plg_schemaorg_organization', 'plugin', 'organization', 'schemaorg', 0, 1, 1, 0, 1, '', '{}', '', 7, 0),
(0, 'plg_schemaorg_person', 'plugin', 'person', 'schemaorg', 0, 1, 1, 0, 1, '', '{}', '', 8, 0),
(0, 'plg_schemaorg_recipe', 'plugin', 'recipe', 'schemaorg', 0, 1, 1, 0, 1, '', '{}', '', 9, 0),
(0, 'plg_schemaorg_custom', 'plugin', 'custom', 'schemaorg', 0, 1, 1, 0, 1, '', '{}', '', 10, 0),

Step 3: Add the Plugin

Download the localbusiness plugin folder from mortezahonar/joomla-cms/plugins/schemaorg/localbusiness and place it here:

plugins/schemaorg/localbusiness

The folder should contain:

plugins/schemaorg/localbusiness/
├── localbusiness.xml
├── forms/
│   └── schemaorg.xml
├── services/
│   └── provider.php
└── src/
    └── Extension/
        └── Localbusiness.php

Step 4: Install Joomla

Install Joomla using your modified nightly build package.


Step 5: Test the Plugin

  1. After installation, go to Extensions → Plugins
  2. Find Schema.org - Localbusiness and make sure it is enabled
  3. Go to System → Clear Cache
  4. Create or edit an article
  5. Go to the "Schema" tab
  6. Select "LocalBusiness" from the schema type dropdown
  7. Fill in the fields (Name, Address, Telephone, etc.)
  8. Save the article
  9. View the article on the frontend
  10. Check the page source (Ctrl+U) for <script type="application/ld+json"> with @type: "LocalBusiness"

Expected Result

The LocalBusiness schema type appears in the dropdown, form fields are displayed, data is saved to the database and appears as JSON-LD in the frontend with @type: "LocalBusiness".


Note: I apologize for not being able to upload the files directly to GitHub at this time due to internet restrictions. I will upload them as soon as possible. Thank you for your understanding.

@brianteeman
Copy link
Copy Markdown
Contributor

We understand the internet restrictions you are facing at this time and hope they will be over soon.

@alikon
Copy link
Copy Markdown
Contributor

alikon commented May 4, 2026

you need to add this new plugin here

// Core plugin extensions - schemaorg
['plugin', 'article', 'schemaorg', 0],
['plugin', 'blogposting', 'schemaorg', 0],
['plugin', 'book', 'schemaorg', 0],
['plugin', 'custom', 'schemaorg', 0],
['plugin', 'event', 'schemaorg', 0],
['plugin', 'jobposting', 'schemaorg', 0],
['plugin', 'organization', 'schemaorg', 0],
['plugin', 'person', 'schemaorg', 0],
['plugin', 'recipe', 'schemaorg', 0],

added localbusiness
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language Change This is for Translators PR-6.2-dev

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants