io-sanita-theme 2.14.0 → 2.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.15.0](https://github.com/RedTurtle/io-sanita-theme/compare/2.14.0...2.15.0) (2025-05-20)
4
+
5
+ ### Features
6
+
7
+ * added SchemaOrg ct servizio ([#88](https://github.com/RedTurtle/io-sanita-theme/issues/88)) ([7cd86d5](https://github.com/RedTurtle/io-sanita-theme/commit/7cd86d5338d0325a93931f590f11234a2cd11fb2))
8
+ * added schemaOrg Struttura ([#89](https://github.com/RedTurtle/io-sanita-theme/issues/89)) ([5b7c091](https://github.com/RedTurtle/io-sanita-theme/commit/5b7c0917da5d9dbed9e3785936645e040707e4cf))
9
+ * Schema.org Event and Homepage ([#87](https://github.com/RedTurtle/io-sanita-theme/issues/87)) ([073148a](https://github.com/RedTurtle/io-sanita-theme/commit/073148a9987b6d2cb045c3a0c274e911ca9a7258))
10
+
11
+ ### Documentation
12
+
13
+ * updated RELEASE.md ([ef8c5d5](https://github.com/RedTurtle/io-sanita-theme/commit/ef8c5d57214932d53f3fd26dcce58703a03d5f4f))
14
+
3
15
  ## [2.14.0](https://github.com/RedTurtle/io-sanita-theme/compare/2.13.0...2.14.0) (2025-05-19)
4
16
 
5
17
  ### Features
package/RELEASE.md CHANGED
@@ -41,6 +41,22 @@
41
41
  - ...
42
42
  -->
43
43
 
44
+ ## Versione 2.15.0 (20/05/2025)
45
+
46
+ ### Novità
47
+
48
+ - Implementato lo Schema.org per i tipi di contenuti Struttura, Servizio ed Evento
49
+
50
+ ### Migliorie
51
+
52
+ - Migliorato lo Schema.org della Homepage
53
+
54
+ ## Versione 2.14.0 (19/05/2025)
55
+
56
+ ### Novità
57
+
58
+ - Implementato lo Schema.org per i tipi di contenuti Notizia, Persona e ComeFarePer
59
+
44
60
  ## Versione 2.11.1 (31/03/2025)
45
61
 
46
62
  ### Fix
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "io-sanita-theme",
3
- "version": "2.14.0",
3
+ "version": "2.15.0",
4
4
  "description": "io-sanita-theme: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "license": "MIT",
@@ -1,30 +1,54 @@
1
1
  import { useIntl } from 'react-intl';
2
2
  import { toPublicURL } from '@plone/volto/helpers';
3
+ import { useSelector } from 'react-redux';
3
4
  import { SiteProperty } from 'volto-site-settings';
4
5
  import { SchemaOrg, getSiteProperty } from 'io-sanita-theme/helpers';
5
6
 
6
7
  const HomeSchemaOrg = ({ content }) => {
7
8
  const intl = useIntl();
9
+ const socialSettings = useSelector((state) => state.socialSettings?.results);
10
+
11
+ const name = SiteProperty({
12
+ property: 'site_title',
13
+ defaultValue: getSiteProperty('siteTitle', intl.locale),
14
+ getValue: true,
15
+ });
16
+ const description = SiteProperty({
17
+ property: 'site_subtitle',
18
+ defaultValue: getSiteProperty('siteSubtitle', intl.locale),
19
+ getValue: true,
20
+ });
21
+
8
22
  let schemaOrg = null;
9
23
  if (content?.['@type'] == 'Plone Site' || content?.['@type'] == 'LRF') {
10
- const name = SiteProperty({
11
- property: 'site_title',
12
- defaultValue: getSiteProperty('siteTitle', intl.locale),
13
- getValue: true,
14
- });
15
- const description = SiteProperty({
16
- property: 'site_subtitle',
17
- defaultValue: getSiteProperty('siteSubtitle', intl.locale),
18
- getValue: true,
19
- });
24
+ let socialLinks = null;
25
+ if (socialSettings && socialSettings?.length > 0) {
26
+ socialLinks = socialSettings.map((item) => item.url);
27
+ }
20
28
 
21
29
  schemaOrg = {
22
- '@type': 'MedicalOrganization',
23
- name: name,
24
- description: description,
25
- url: toPublicURL(content['@id']),
30
+ '@graph': [
31
+ {
32
+ '@type': 'WebSite',
33
+ url: toPublicURL('/'),
34
+ name: name,
35
+ description: description || null,
36
+ potentialAction: {
37
+ '@type': 'SearchAction',
38
+ target: toPublicURL(content['@id']) + '/search',
39
+ },
40
+ },
41
+ {
42
+ '@type': 'MedicalOrganization',
43
+ name: name,
44
+ description: description || null,
45
+ url: toPublicURL('/'),
46
+ sameAs: socialLinks,
47
+ },
48
+ ],
26
49
  };
27
50
  }
51
+
28
52
  return schemaOrg ? <SchemaOrg schema={schemaOrg} /> : <></>;
29
53
  };
30
54
 
@@ -0,0 +1,137 @@
1
+ import { toPublicURL } from '@plone/volto/helpers';
2
+ import {
3
+ SchemaOrg,
4
+ SchemaOrgUtils,
5
+ richTextHasContent,
6
+ } from 'io-sanita-theme/helpers';
7
+
8
+ const EventoSchemaOrg = ({ content }) => {
9
+ let schemaOrg = {
10
+ '@type': 'Event',
11
+ name: content?.title,
12
+ startDate: content?.start,
13
+ endDate: content?.end,
14
+ url: toPublicURL(content['@id']),
15
+ };
16
+
17
+ let description = [];
18
+ if (content.description) {
19
+ description.push(content.description);
20
+ }
21
+ if (richTextHasContent(content.descrizione_estesa)) {
22
+ description.push(
23
+ SchemaOrgUtils.fieldDataToPlainText(content.descrizione_estesa),
24
+ );
25
+ }
26
+ if (description.length > 0) {
27
+ schemaOrg.description = description.join('. ');
28
+ }
29
+
30
+ // se l'evento è online
31
+ if (richTextHasContent(content.webinar)) {
32
+ schemaOrg.eventAttendanceMode = SchemaOrgUtils.fieldDataToPlainText(
33
+ content.webinar,
34
+ );
35
+ }
36
+ // se l'evento è fisico priorità all'indirizzo scritto direttamente nel CT, in alternativa la prima struttura associata
37
+ if (content.street && content.zip_code && content.city) {
38
+ schemaOrg.location = {
39
+ '@type': 'Place',
40
+ name: content?.nome_sede || 'Sede',
41
+ address: {
42
+ '@type': 'PostalAddress',
43
+ streetAddress: content.street,
44
+ addressLocality: content.city,
45
+ postalCode: content.zip_code,
46
+ addressCountry: 'IT',
47
+ },
48
+ };
49
+ } else if (content.struttura_correlata.length > 0) {
50
+ schemaOrg.location = {
51
+ '@type': 'Place',
52
+ name: content.struttura_correlata[0].title,
53
+ address: {
54
+ '@type': 'PostalAddress',
55
+ // questi sono campi obbligatori per la struttura
56
+ streetAddress: content.struttura_correlata[0].street,
57
+ addressLocality: content.struttura_correlata[0].city,
58
+ postalCode: content.struttura_correlata[0].zip_code,
59
+ addressCountry: 'IT',
60
+ },
61
+ };
62
+ }
63
+
64
+ // organizzatore interno
65
+ if (content.organizzato_da_interno.length > 0) {
66
+ schemaOrg.organizer = {
67
+ '@type': 'Organization',
68
+ name: content.organizzato_da_interno[0].title,
69
+ url: toPublicURL(content.organizzato_da_interno[0]['@id']),
70
+ };
71
+ }
72
+
73
+ // contributo esterno
74
+ if (richTextHasContent(content.organizzato_da_esterno)) {
75
+ schemaOrg.contributor = {
76
+ '@type': 'Organization',
77
+ name: SchemaOrgUtils.fieldDataToPlainText(content.organizzato_da_esterno),
78
+ };
79
+ }
80
+
81
+ //chi partecipa
82
+ let attendeeList = [];
83
+ if (richTextHasContent(content.parteciperanno)) {
84
+ attendeeList.push(
85
+ SchemaOrgUtils.fieldDataToPlainText(content.parteciperanno),
86
+ );
87
+ }
88
+ if (content.persona_correlata.length > 0) {
89
+ attendeeList.push(content.persona_correlata.map((item) => item.title));
90
+ }
91
+ if (attendeeList.length > 0) {
92
+ schemaOrg.attendee = {
93
+ '@type': 'Person',
94
+ name: attendeeList.join(', '),
95
+ };
96
+ }
97
+
98
+ // a chi si rivolge
99
+ let audienceList = [];
100
+ if (richTextHasContent(content.a_chi_si_rivolge)) {
101
+ audienceList.push(
102
+ SchemaOrgUtils.fieldDataToPlainText(content.a_chi_si_rivolge),
103
+ );
104
+ }
105
+ if (content.a_chi_si_rivolge_tassonomia.length > 0) {
106
+ audienceList.push(
107
+ content.a_chi_si_rivolge_tassonomia.map((item) => item.title),
108
+ );
109
+ }
110
+ if (audienceList.length > 0) {
111
+ schemaOrg.audience = {
112
+ '@type': 'Audience',
113
+ audienceType: audienceList.join(', '),
114
+ };
115
+ }
116
+
117
+ // costi o biglietti
118
+ if (richTextHasContent(content.costo)) {
119
+ schemaOrg.offers = {
120
+ '@type': 'Offer',
121
+ price: SchemaOrgUtils.fieldDataToPlainText(content.costo),
122
+ priceCurrency: 'EUR',
123
+ };
124
+ }
125
+
126
+ // sponsor
127
+ if (richTextHasContent(content.patrocinato_da)) {
128
+ schemaOrg.sponsor = {
129
+ '@type': 'Organization',
130
+ name: SchemaOrgUtils.fieldDataToPlainText(content.patrocinato_da),
131
+ };
132
+ }
133
+
134
+ return <SchemaOrg content={content} schema={schemaOrg} />;
135
+ };
136
+
137
+ export default EventoSchemaOrg;
@@ -20,6 +20,7 @@ import {
20
20
  } from 'io-sanita-theme/components/View/commons';
21
21
 
22
22
  import {
23
+ EventoSchemaOrg,
23
24
  EventoCosE,
24
25
  EventoPartecipanti,
25
26
  EventoAChiSiRivolge,
@@ -38,6 +39,7 @@ import {
38
39
  } from 'io-sanita-theme/components/View/Evento';
39
40
 
40
41
  export const EventoViewSectionsOrder = [
42
+ { /* METADATI SCHEMA.ORG */ component: EventoSchemaOrg },
41
43
  { /* COS'è */ component: EventoCosE },
42
44
  { /* CHI PARTECIPA */ component: EventoPartecipanti },
43
45
  { /* EVENTI PADRI */ component: EventoFaParteDi },
@@ -111,3 +111,9 @@ export const EventoEventiCorrelati = loadable(
111
111
  /* webpackChunkName: "ISEventView" */ 'io-sanita-theme/components/View/Evento/EventoEventiCorrelati'
112
112
  ),
113
113
  );
114
+ export const EventoSchemaOrg = loadable(
115
+ () =>
116
+ import(
117
+ /* webpackChunkName: "ISEventView" */ 'io-sanita-theme/components/View/Evento/EventoSchemaOrg'
118
+ ),
119
+ );
@@ -0,0 +1,126 @@
1
+ import { toPublicURL, isInternalURL } from '@plone/volto/helpers';
2
+ import { useIntl } from 'react-intl';
3
+ import { SiteProperty } from 'volto-site-settings';
4
+ import {
5
+ SchemaOrg,
6
+ SchemaOrgUtils,
7
+ richTextHasContent,
8
+ getSiteProperty,
9
+ } from 'io-sanita-theme/helpers';
10
+
11
+ const ServizioSchemaOrg = ({ content }) => {
12
+ const intl = useIntl();
13
+
14
+ let siteTitle = SiteProperty({
15
+ property: 'site_title',
16
+ getValue: true,
17
+ defaultTitle: getSiteProperty('siteTitle', intl.locale),
18
+ });
19
+
20
+ const schemaOrg = {
21
+ '@type': 'Service',
22
+ name: content.title,
23
+ brand: {
24
+ '@type': 'Organization',
25
+ name: siteTitle,
26
+ },
27
+ areaServed: {
28
+ '@type': 'AdministrativeArea',
29
+ name: richTextHasContent(content.copertura_geografica)
30
+ ? SchemaOrgUtils.fieldDataToPlainText(content.copertura_geografica)
31
+ : siteTitle,
32
+ },
33
+ availableChannel: {
34
+ '@type': 'ServiceChannel',
35
+ name: 'Dove rivolgersi',
36
+ availableLanguage: {
37
+ '@type': 'Language',
38
+ name: 'Italian',
39
+ alternateName: 'it',
40
+ },
41
+ },
42
+ };
43
+
44
+ let description = [];
45
+ if (content.description) {
46
+ description.push(content.description);
47
+ }
48
+ if (richTextHasContent(content.descrizione_estesa)) {
49
+ description.push(
50
+ SchemaOrgUtils.fieldDataToPlainText(content.descrizione_estesa),
51
+ );
52
+ }
53
+ if (description.length > 0) {
54
+ schemaOrg.description = description.join('. ');
55
+ }
56
+
57
+ if (content.tipologia_servizio?.title) {
58
+ schemaOrg.serviceType = content.tipologia_servizio.title;
59
+ }
60
+
61
+ // a chi si rivolge
62
+ if (richTextHasContent(content.a_chi_si_rivolge)) {
63
+ schemaOrg.audience = {
64
+ '@type': 'Audience',
65
+ audienceType: SchemaOrgUtils.fieldDataToPlainText(
66
+ content.a_chi_si_rivolge,
67
+ ),
68
+ };
69
+ }
70
+
71
+ if (content.prenota_online_link) {
72
+ schemaOrg.availableChannel.serviceUrl = isInternalURL(
73
+ content.prenota_online_link,
74
+ )
75
+ ? toPublicURL(content.prenota_online_link)
76
+ : content.prenota_online_link;
77
+ }
78
+
79
+ if (content.struttura_correlata.length > 0) {
80
+ schemaOrg.availableChannel.serviceLocation =
81
+ content.struttura_correlata.map((struttura) => {
82
+ return {
83
+ '@type': 'Place',
84
+ name: struttura.title,
85
+ url: toPublicURL(struttura['@id']),
86
+ address: {
87
+ '@type': 'PostalAddress',
88
+ streetAddress: struttura?.street || null,
89
+ postalCode: struttura?.zip_code || null,
90
+ addressLocality: struttura?.city || null,
91
+ },
92
+ };
93
+ });
94
+ }
95
+
96
+ // di UO se ne possono selezionare soltanto una
97
+ if (content.uo_correlata.length > 0) {
98
+ schemaOrg.provider = {
99
+ '@type': 'Place',
100
+ name: content.uo_correlata[0].title,
101
+ url: toPublicURL(content.uo_correlata[0]['@id']),
102
+ address: {
103
+ '@type': 'PostalAddress',
104
+ streetAddress: content.uo_correlata[0]?.street || null,
105
+ postalCode: content.uo_correlata[0]?.zip_code || null,
106
+ addressLocality: content.uo_correlata[0]?.city || null,
107
+ },
108
+ };
109
+ }
110
+
111
+ // costi o biglietti
112
+ if (richTextHasContent(content.costi)) {
113
+ schemaOrg.hasOfferCatalog = {
114
+ '@type': 'OfferCatalog',
115
+ itemListElement: [
116
+ {
117
+ name: SchemaOrgUtils.fieldDataToPlainText(content.costi),
118
+ },
119
+ ],
120
+ };
121
+ }
122
+
123
+ return <SchemaOrg content={content} schema={schemaOrg} />;
124
+ };
125
+
126
+ export default ServizioSchemaOrg;
@@ -23,6 +23,7 @@ import {
23
23
  ServizioNotizie,
24
24
  ServizioUlterioriInformazioni,
25
25
  ServizioDocumenti,
26
+ ServizioSchemaOrg,
26
27
  } from 'io-sanita-theme/components/View/Servizio';
27
28
 
28
29
  import { ContentTypeViewSections } from 'io-sanita-theme/helpers';
@@ -39,6 +40,7 @@ import {
39
40
  } from 'io-sanita-theme/components/View/commons';
40
41
 
41
42
  export const ServizioSectionsOrder = [
43
+ { /* SCHEMA ORG */ component: ServizioSchemaOrg },
42
44
  { /* COSA SERVE */ component: ServizioCosaServe },
43
45
  { /* ACCEDI AL SERVIZIO */ component: ServizioAccediAlServizio },
44
46
  { /* TEMPI DI ATTESA */ component: ServizioTempiDiAttesa },
@@ -1,87 +1,110 @@
1
1
  import loadable from '@loadable/component';
2
2
 
3
- export const ServizioView = loadable(() =>
4
- import(
5
- /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioView'
6
- ),
7
- );
8
- export const ServizioCosE = loadable(() =>
9
- import(
10
- /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioCosE'
11
- ),
12
- );
13
- export const ServizioCosaServe = loadable(() =>
14
- import(
15
- /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioCosaServe'
16
- ),
17
- );
18
- export const ServizioAccediAlServizio = loadable(() =>
19
- import(
20
- /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioAccediAlServizio'
21
- ),
22
- );
23
- export const ServizioTempiDiAttesa = loadable(() =>
24
- import(
25
- /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioTempiDiAttesa'
26
- ),
27
- );
28
- export const ServizioCosti = loadable(() =>
29
- import(
30
- /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioCosti'
31
- ),
32
- );
33
- export const ServizioDove = loadable(() =>
34
- import(
35
- /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioDove'
36
- ),
37
- );
38
- export const ServizioOrari = loadable(() =>
39
- import(
40
- /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioOrari'
41
- ),
42
- );
43
- export const ServizioContatti = loadable(() =>
44
- import(
45
- /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioContatti'
46
- ),
47
- );
48
- export const ServizioAChiSiRivolge = loadable(() =>
49
- import(
50
- /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioAChiSiRivolge'
51
- ),
52
- );
53
- export const ServizioProcedureCollegate = loadable(() =>
54
- import(
55
- /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioProcedureCollegate'
56
- ),
57
- );
58
- export const ServizioUOResponsabile = loadable(() =>
59
- import(
60
- /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioUOResponsabile'
61
- ),
62
- );
63
- export const ServizioResponsabile = loadable(() =>
64
- import(
65
- /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioResponsabile'
66
- ),
67
- );
68
- export const ServizioUlterioriInformazioni = loadable(() =>
69
- import(
70
- /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioUlterioriInformazioni'
71
- ),
72
- );
73
- export const ServizioDocumenti = loadable(() =>
74
- import(
75
- /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioDocumenti'
76
- ),
77
- );
78
- export const ServizioServiziCorrelati = loadable(() =>
79
- import(
80
- /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioServiziCorrelati'
81
- ),
82
- );
83
- export const ServizioNotizie = loadable(() =>
84
- import(
85
- /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioNotizie'
86
- ),
3
+ export const ServizioView = loadable(
4
+ () =>
5
+ import(
6
+ /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioView'
7
+ ),
8
+ );
9
+ export const ServizioCosE = loadable(
10
+ () =>
11
+ import(
12
+ /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioCosE'
13
+ ),
14
+ );
15
+ export const ServizioCosaServe = loadable(
16
+ () =>
17
+ import(
18
+ /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioCosaServe'
19
+ ),
20
+ );
21
+ export const ServizioAccediAlServizio = loadable(
22
+ () =>
23
+ import(
24
+ /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioAccediAlServizio'
25
+ ),
26
+ );
27
+ export const ServizioTempiDiAttesa = loadable(
28
+ () =>
29
+ import(
30
+ /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioTempiDiAttesa'
31
+ ),
32
+ );
33
+ export const ServizioCosti = loadable(
34
+ () =>
35
+ import(
36
+ /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioCosti'
37
+ ),
38
+ );
39
+ export const ServizioDove = loadable(
40
+ () =>
41
+ import(
42
+ /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioDove'
43
+ ),
44
+ );
45
+ export const ServizioOrari = loadable(
46
+ () =>
47
+ import(
48
+ /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioOrari'
49
+ ),
50
+ );
51
+ export const ServizioContatti = loadable(
52
+ () =>
53
+ import(
54
+ /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioContatti'
55
+ ),
56
+ );
57
+ export const ServizioAChiSiRivolge = loadable(
58
+ () =>
59
+ import(
60
+ /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioAChiSiRivolge'
61
+ ),
62
+ );
63
+ export const ServizioProcedureCollegate = loadable(
64
+ () =>
65
+ import(
66
+ /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioProcedureCollegate'
67
+ ),
68
+ );
69
+ export const ServizioUOResponsabile = loadable(
70
+ () =>
71
+ import(
72
+ /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioUOResponsabile'
73
+ ),
74
+ );
75
+ export const ServizioResponsabile = loadable(
76
+ () =>
77
+ import(
78
+ /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioResponsabile'
79
+ ),
80
+ );
81
+ export const ServizioUlterioriInformazioni = loadable(
82
+ () =>
83
+ import(
84
+ /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioUlterioriInformazioni'
85
+ ),
86
+ );
87
+ export const ServizioDocumenti = loadable(
88
+ () =>
89
+ import(
90
+ /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioDocumenti'
91
+ ),
92
+ );
93
+ export const ServizioServiziCorrelati = loadable(
94
+ () =>
95
+ import(
96
+ /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioServiziCorrelati'
97
+ ),
98
+ );
99
+ export const ServizioNotizie = loadable(
100
+ () =>
101
+ import(
102
+ /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioNotizie'
103
+ ),
104
+ );
105
+ export const ServizioSchemaOrg = loadable(
106
+ () =>
107
+ import(
108
+ /* webpackChunkName: "ISServizioView" */ 'io-sanita-theme/components/View/Servizio/ServizioSchemaOrg'
109
+ ),
87
110
  );
@@ -0,0 +1,70 @@
1
+ import { toPublicURL } from '@plone/volto/helpers';
2
+ import {
3
+ SchemaOrgUtils,
4
+ richTextHasContent,
5
+ SchemaOrg,
6
+ } from 'io-sanita-theme/helpers';
7
+
8
+ const StrutturaSchemaOrg = ({ content }) => {
9
+ let siteTitle = SchemaOrgUtils.getSiteTitle();
10
+
11
+ let schemaOrg = {
12
+ '@type': 'MedicalOrganization',
13
+ url: toPublicURL(content['@id']),
14
+ name: siteTitle,
15
+
16
+ address: {
17
+ '@type': 'PostalAddress',
18
+ streetAddress: content.street,
19
+ postalCode: content.zip_code,
20
+ addressLocality: content.city,
21
+ },
22
+ };
23
+ if (content.tipologia_struttura?.title) {
24
+ schemaOrg.additionalType = content.tipologia_struttura?.title;
25
+ }
26
+ let description = [];
27
+
28
+ if (content.description) {
29
+ description.push(content.description);
30
+ }
31
+
32
+ if (richTextHasContent(content.descrizione_estesa)) {
33
+ description.push(
34
+ SchemaOrgUtils.fieldDataToPlainText(content.descrizione_estesa),
35
+ );
36
+ }
37
+
38
+ if (content.pdc_correlato?.length > 0) {
39
+ schemaOrg.contactPoint = content.pdc_correlato.map((pdc) => {
40
+ const contact = {
41
+ '@type': 'ContactPoint',
42
+ contactType: pdc.type_title,
43
+ name: pdc.title,
44
+ };
45
+
46
+ pdc.contatti?.forEach((c) => {
47
+ if (c.tipo === 'email') {
48
+ if (!contact.email) contact.email = c.valore;
49
+ else if (typeof contact.email === 'string') {
50
+ contact.email = [contact.email, c.valore];
51
+ } else {
52
+ contact.email.push(c.valore);
53
+ }
54
+ } else if (c.tipo === 'telefono') {
55
+ contact.telephone = c.valore;
56
+ } else if (c.tipo === 'url') {
57
+ contact.url = c.valore.startsWith('http')
58
+ ? c.valore
59
+ : `https://${c.valore}`;
60
+ }
61
+ });
62
+
63
+ return contact;
64
+ });
65
+ }
66
+
67
+ return <SchemaOrg content={content} schema={schemaOrg} />;
68
+ };
69
+
70
+ export default StrutturaSchemaOrg;
@@ -16,6 +16,7 @@ import {
16
16
  StrutturaServizi,
17
17
  StrutturaResponsabile,
18
18
  StrutturaPersonale,
19
+ StrutturaSchemaOrg,
19
20
  StrutturaNotizie,
20
21
  StrutturaGalleria,
21
22
  StrutturaUfficiCorrelati,
@@ -38,6 +39,7 @@ import {
38
39
  } from 'io-sanita-theme/components/View/commons';
39
40
 
40
41
  export const StrutturaSectionsOrder = [
42
+ { /* METATAG SchemaOrg */ component: StrutturaSchemaOrg },
41
43
  { /* COS'è */ component: StrutturaCosE },
42
44
  { /* A CHI SI RIVOLGE */ component: StrutturaAChiSiRivolge },
43
45
  { /* DOVE */ component: StrutturaDove },
@@ -80,3 +80,8 @@ export const StrutturaAllegati = loadable(() =>
80
80
  /* webpackChunkName: "ISStrutturaView" */ 'io-sanita-theme/components/View/Struttura/StrutturaAllegati'
81
81
  ),
82
82
  );
83
+ export const StrutturaSchemaOrg = loadable(() =>
84
+ import(
85
+ /* webpackChunkName: "ISStrutturaView" */ 'io-sanita-theme/components/View/Struttura/StrutturaSchemaOrg'
86
+ ),
87
+ );