Skip to content

Commit 3ff5b7a

Browse files
committed
chore: disable custom schemaorg when @redturtle/volto-schemaorg is active
1 parent d96cabf commit 3ff5b7a

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/components/ItaliaTheme/View/ServizioView/ServizioMetatag.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import { useIntl } from 'react-intl';
22
import { Helmet, toPublicURL, isInternalURL } from '@plone/volto/helpers';
3+
import config from '@plone/volto/registry';
34
import { SiteProperty } from 'volto-site-settings';
45
import { getSiteProperty } from 'design-comuni-plone-theme/helpers';
56
import { richTextHasContent } from 'design-comuni-plone-theme/components/ItaliaTheme/View';
67

8+
const isVoltoSchemaorgInstalled = config.settings.addonsInfo.some(
9+
(addon) => addon.name === '@redturtle/volto-schemaorg',
10+
);
11+
712
const fieldDataToPlainText = (field) => {
813
return field.blocks_layout.items.reduce((accumulator, item, index) => {
914
if (field.blocks[item]['@type'] === 'text') {
@@ -20,6 +25,11 @@ const fieldDataToPlainText = (field) => {
2025

2126
const ServizioMetatag = ({ content }) => {
2227
const intl = useIntl();
28+
29+
if (isVoltoSchemaorgInstalled) {
30+
return null;
31+
}
32+
2333
let siteTitle = SiteProperty({
2434
property: 'site_title',
2535
getValue: true,

0 commit comments

Comments
 (0)