Skip to content

Commit 2fac558

Browse files
committed
fix : updated form and used the interface check to render form
1 parent 6b71fbf commit 2fac558

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

plugins/system/opengraph/language/en-GB/plg_system_opengraph.ini

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,19 +107,23 @@ PLG_SYSTEM_OPENGRAPH_FB_APP_ID_HINT="Enter your Facebook App ID to enable Facebo
107107

108108

109109
; Field Selection (New Section)
110-
PLG_SYSTEM_OPENGRAPH_FIELD_MAPPING_SECTION="Custom Field Mapping"
111-
PLG_SYSTEM_OPENGRAPH_MANUAL_OVERRIDE_SECTION="Manual Override Values"
110+
PLG_SYSTEM_OPENGRAPH_FIELD_MAPPING_SECTION="Field Mapping Configuration"
111+
PLG_SYSTEM_OPENGRAPH_MANUAL_OVERRIDE_SECTION="Manual Override Options"
112112

113-
PLG_SYSTEM_OPENGRAPH_TITLE_FIELD_LABEL="Title Custom Field"
114-
PLG_SYSTEM_OPENGRAPH_TITLE_FIELD_DESC="Select a custom field to use as the OpenGraph title source."
113+
PLG_SYSTEM_OPENGRAPH_TITLE_FIELD_LABEL="Title Source"
114+
PLG_SYSTEM_OPENGRAPH_TITLE_FIELD_DESC="Select which article field to use for og:title meta tag"
115115

116-
PLG_SYSTEM_OPENGRAPH_DESCRIPTION_FIELD_LABEL="Description Custom Field"
117-
PLG_SYSTEM_OPENGRAPH_DESCRIPTION_FIELD_DESC="Select a custom field to use as the OpenGraph description source."
116+
PLG_SYSTEM_OPENGRAPH_DESCRIPTION_FIELD_LABEL="Description Source"
117+
PLG_SYSTEM_OPENGRAPH_DESCRIPTION_FIELD_DESC="Select which article field to use for og:description meta tag. Meta description is preferred over article text."
118118

119-
PLG_SYSTEM_OPENGRAPH_IMAGE_FIELD_LABEL="Image Custom Field"
120-
PLG_SYSTEM_OPENGRAPH_IMAGE_FIELD_DESC="Select a custom field to use as the OpenGraph image source."
119+
PLG_SYSTEM_OPENGRAPH_IMAGE_FIELD_LABEL="Image Source"
120+
PLG_SYSTEM_OPENGRAPH_IMAGE_FIELD_DESC="Select which article field to use for og:image meta tag"
121121

122-
PLG_SYSTEM_OPENGRAPH_TYPE_FIELD_LABEL="Type Custom Field"
122+
PLG_SYSTEM_OPENGRAPH_IMAGE_ALT_FIELD_LABEL="Image Alt Text Source"
123+
PLG_SYSTEM_OPENGRAPH_IMAGE_ALT_FIELD_DESC="Select which article field to use for og:image:alt meta tag for accessibility"
124+
125+
PLG_SYSTEM_OPENGRAPH_TYPE_FIELD_LABEL="Type Field"
123126
PLG_SYSTEM_OPENGRAPH_TYPE_FIELD_DESC="Select a custom field to use as the OpenGraph type source."
124127

125-
PLG_SYSTEM_OPENGRAPH_NO_FIELD_SELECTED="No custom field selected"
128+
PLG_SYSTEM_OPENGRAPH_NO_FIELD_SELECTED="-- No Field Selected --"
129+

plugins/system/opengraph/src/Extension/opengraph.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Joomla\CMS\Table\Table;
2121
use Joomla\Registry\Registry;
2222
use Joomla\CMS\Document\Document;
23+
use Joomla\CMS\Opengraph\OpengraphServiceInterface;
2324
use Joomla\CMS\Uri\Uri;
2425

2526

@@ -131,15 +132,8 @@ public function onContentPrepareForm(PrepareFormEvent $event): void
131132

132133
$form = $event->getForm();
133134
$name = $form->getName();
134-
135-
//todo : replace with interface check
136-
$supportedForms = [
137-
'com_content.article',
138-
'com_categories.categorycom_content',
139-
'com_menus.item'
140-
];
141-
142-
if (!in_array($name, $supportedForms, true)) {
135+
$component = $app->bootComponent('com_content');
136+
if (!$component instanceof OpengraphServiceInterface) {
143137
return;
144138
}
145139

0 commit comments

Comments
 (0)