Skip to content

Commit baf3440

Browse files
committed
CMS-45730 Add SEO, Site Settings property groups and update contet types
1 parent dc268db commit baf3440

File tree

6 files changed

+112
-14
lines changed

6 files changed

+112
-14
lines changed

templates/alloy-template/optimizely.config.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,16 @@ import { buildConfig } from '@optimizely/cms-sdk';
22

33
export default buildConfig({
44
components: ['./src/components/*.tsx', './src/components/**/*.tsx'],
5+
propertyGroups: [
6+
{
7+
key: 'SEO',
8+
displayName: 'SEO',
9+
sortOrder: 1,
10+
},
11+
{
12+
key: 'SiteSettings',
13+
displayName: 'Site Settings',
14+
sortOrder: 2,
15+
},
16+
],
517
});

templates/alloy-template/src/app/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import './globals.css';
1010
import Teaser, { TeaserContentType } from '@/components/base/Teaser';
1111
import Editorial, { EditorialContentType } from '@/components/base/Editorial';
1212
import Contact, { ContactContentType } from '@/components/base/Contact';
13-
import StartPage, { StartContentType } from '@/components/Start';
13+
import Start, { StartContentType } from '@/components/Start';
1414
import Product, { ProductContentType } from '@/components/Product';
1515
import Standard, { StandardContentType } from '@/components/Standard';
1616
import Notice, { NoticeContentType } from '@/components/base/Notice';
@@ -55,7 +55,7 @@ initReactComponentRegistry({
5555
Notice,
5656
Product,
5757
Standard,
58-
StartPage,
58+
Start,
5959
Teaser,
6060
BlankSection,
6161
},

templates/alloy-template/src/components/News.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,30 @@ export const NewsContentType = contentType({
2929
type: 'richText',
3030
displayName: 'Main Body',
3131
},
32+
// SEO group
33+
site_title: {
34+
type: 'string',
35+
displayName: 'Title',
36+
group: 'SEO',
37+
},
38+
keywords: {
39+
type: 'array',
40+
items: {
41+
type: 'string',
42+
},
43+
displayName: 'Keywords',
44+
group: 'SEO',
45+
},
46+
page_description: {
47+
type: 'string',
48+
displayName: 'Page Description',
49+
group: 'SEO',
50+
},
51+
disable_indexing: {
52+
type: 'boolean',
53+
displayName: 'Disable Indexing',
54+
group: 'SEO',
55+
},
3256
},
3357
});
3458

templates/alloy-template/src/components/Product.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,30 @@ export const ProductContentType = contentType({
3535
},
3636
displayName: 'Content Area',
3737
},
38+
// SEO group
39+
site_title: {
40+
type: 'string',
41+
displayName: 'Title',
42+
group: 'SEO',
43+
},
44+
keywords: {
45+
type: 'array',
46+
items: {
47+
type: 'string',
48+
},
49+
displayName: 'Keywords',
50+
group: 'SEO',
51+
},
52+
page_description: {
53+
type: 'string',
54+
displayName: 'Page Description',
55+
group: 'SEO',
56+
},
57+
disable_indexing: {
58+
type: 'boolean',
59+
displayName: 'Disable Indexing',
60+
group: 'SEO',
61+
},
3862
},
3963
});
4064

templates/alloy-template/src/components/Standard.tsx

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const StandardContentType = contentType({
1010
key: 'Standard',
1111
displayName: 'Standard Page',
1212
baseType: '_experience',
13-
mayContainTypes: ['_self', 'News'],
13+
mayContainTypes: ['_self', 'News'], // Passed 'News' as a string to avoid circular dependency
1414
properties: {
1515
image: {
1616
type: 'contentReference',
@@ -29,6 +29,30 @@ export const StandardContentType = contentType({
2929
type: 'richText',
3030
displayName: 'Main Body',
3131
},
32+
// SEO group
33+
site_title: {
34+
type: 'string',
35+
displayName: 'Title',
36+
group: 'SEO',
37+
},
38+
keywords: {
39+
type: 'array',
40+
items: {
41+
type: 'string',
42+
},
43+
displayName: 'Keywords',
44+
group: 'SEO',
45+
},
46+
page_description: {
47+
type: 'string',
48+
displayName: 'Page Description',
49+
group: 'SEO',
50+
},
51+
disable_indexing: {
52+
type: 'boolean',
53+
displayName: 'Disable Indexing',
54+
group: 'SEO',
55+
},
3256
},
3357
});
3458

templates/alloy-template/src/components/Start.tsx

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const StartContentType = contentType({
2424
},
2525
title: {
2626
type: 'string',
27-
displayName: 'Title',
27+
displayName: 'Teaser Title',
2828
group: 'Information',
2929
},
3030
description: {
@@ -54,71 +54,85 @@ export const StartContentType = contentType({
5454
displayName: 'Hide Site Footer',
5555
group: 'Advanced',
5656
},
57-
// Metadata group
57+
// SEO group
5858
site_title: {
5959
type: 'string',
6060
displayName: 'Title',
61+
group: 'SEO',
6162
},
6263
keywords: {
63-
type: 'string',
64+
type: 'array',
65+
items: {
66+
type: 'string',
67+
},
6468
displayName: 'Keywords',
69+
group: 'SEO',
6570
},
6671
page_description: {
6772
type: 'string',
6873
displayName: 'Page Description',
74+
group: 'SEO',
6975
},
7076
disable_indexing: {
7177
type: 'boolean',
7278
displayName: 'Disable Indexing',
79+
group: 'SEO',
7380
},
7481
// siteSettings group
75-
content_pages: {
82+
contact_pages: {
7683
type: 'contentReference',
7784
allowedTypes: ['_page'],
78-
displayName: 'Content Pages',
85+
displayName: 'Contact Pages',
7986
},
8087
global_news: {
8188
type: 'contentReference',
8289
allowedTypes: ['_page'],
8390
displayName: 'Global News',
91+
group: 'SiteSettings',
8492
},
85-
logo_type: {
93+
search_page: {
8694
type: 'contentReference',
8795
allowedTypes: ['_page'],
88-
displayName: 'Logo Type',
96+
displayName: 'Search Page',
97+
group: 'SiteSettings',
8998
},
90-
search_page: {
99+
logo_type: {
91100
type: 'contentReference',
92101
allowedTypes: ['_page'],
93-
displayName: 'Search Page',
102+
displayName: 'Logo Type',
103+
group: 'SiteSettings',
94104
},
95105
products: {
96106
type: 'array',
97107
items: {
98108
type: 'link',
99109
},
100110
displayName: 'Products',
111+
group: 'SiteSettings',
101112
},
102113
company_information: {
103114
type: 'array',
104115
items: {
105116
type: 'link',
106117
},
107118
displayName: 'Company Information',
119+
group: 'SiteSettings',
108120
},
109121
local_news: {
110122
type: 'array',
111123
items: {
112124
type: 'link',
113125
},
114126
displayName: 'Local News',
127+
group: 'SiteSettings',
115128
},
116129
customer_zone: {
117130
type: 'array',
118131
items: {
119132
type: 'link',
120133
},
121134
displayName: 'Customer Zone',
135+
group: 'SiteSettings',
122136
},
123137
},
124138
});
@@ -132,7 +146,7 @@ function ComponentWrapper({ children, node }: ComponentContainerProps) {
132146
return <div {...pa(node)}>{children}</div>;
133147
}
134148

135-
function StartPage({ opti }: StartProps) {
149+
function Start({ opti }: StartProps) {
136150
return (
137151
<>
138152
<div
@@ -179,4 +193,4 @@ function StartPage({ opti }: StartProps) {
179193
);
180194
}
181195

182-
export default StartPage;
196+
export default Start;

0 commit comments

Comments
 (0)