From 1ce49ad20322cbb21b0dfb0b31ac97b159c518cf Mon Sep 17 00:00:00 2001 From: Neli Kostadinova Date: Mon, 12 Aug 2024 11:23:50 +0300 Subject: [PATCH 1/2] Author list and author details simple variants --- .../Headless Variants/Author Details.yml | 13 ++++++ .../Author Details/Simple.yml | 13 ++++++ .../Headless Variants/Author List/Simple.yml | 13 ++++++ .../Partial Designs/Author Content.yml | 7 +++- .../components/_component-author-details.scss | 25 +++++++++++ .../components/author-list/_author-list.scss | 13 ++++++ .../components/PageContent/AuthorDetails.tsx | 30 +++++++++++++ .../src/components/PageContent/AuthorList.tsx | 42 +++++++++++++++++++ 8 files changed, 154 insertions(+), 2 deletions(-) create mode 100644 src/items/sxa-content/content/Verticals/Services/Presentation/Headless Variants/Author Details.yml create mode 100644 src/items/sxa-content/content/Verticals/Services/Presentation/Headless Variants/Author Details/Simple.yml create mode 100644 src/items/sxa-content/content/Verticals/Services/Presentation/Headless Variants/Author List/Simple.yml diff --git a/src/items/sxa-content/content/Verticals/Services/Presentation/Headless Variants/Author Details.yml b/src/items/sxa-content/content/Verticals/Services/Presentation/Headless Variants/Author Details.yml new file mode 100644 index 00000000..bf787c38 --- /dev/null +++ b/src/items/sxa-content/content/Verticals/Services/Presentation/Headless Variants/Author Details.yml @@ -0,0 +1,13 @@ +--- +ID: "1f79dead-a422-4b15-a242-d55a20da91e9" +Parent: "7a66a4de-85d6-4358-af3f-8c4b4aac7bd2" +Template: "49c111d0-6867-4798-a724-1f103166e6e9" +Path: /sitecore/content/Verticals/Services/Presentation/Headless Variants/Author Details +Languages: +- Language: en + Versions: + - Version: 1 + Fields: + - ID: "8cdc337e-a112-42fb-bbb4-4143751e123f" + Hint: __Revision + Value: "789ac7ec-d2f8-4222-b734-92b67246bf22" diff --git a/src/items/sxa-content/content/Verticals/Services/Presentation/Headless Variants/Author Details/Simple.yml b/src/items/sxa-content/content/Verticals/Services/Presentation/Headless Variants/Author Details/Simple.yml new file mode 100644 index 00000000..ca9de022 --- /dev/null +++ b/src/items/sxa-content/content/Verticals/Services/Presentation/Headless Variants/Author Details/Simple.yml @@ -0,0 +1,13 @@ +--- +ID: "5faaa36d-77f3-4b48-91d0-1b76f6e24a92" +Parent: "1f79dead-a422-4b15-a242-d55a20da91e9" +Template: "4d50cdae-c2d9-4de8-b080-8f992bfb1b55" +Path: /sitecore/content/Verticals/Services/Presentation/Headless Variants/Author Details/Simple +Languages: +- Language: en + Versions: + - Version: 1 + Fields: + - ID: "8cdc337e-a112-42fb-bbb4-4143751e123f" + Hint: __Revision + Value: "b2109086-0f0d-4095-93a4-df1d66f3b1fb" diff --git a/src/items/sxa-content/content/Verticals/Services/Presentation/Headless Variants/Author List/Simple.yml b/src/items/sxa-content/content/Verticals/Services/Presentation/Headless Variants/Author List/Simple.yml new file mode 100644 index 00000000..495d395b --- /dev/null +++ b/src/items/sxa-content/content/Verticals/Services/Presentation/Headless Variants/Author List/Simple.yml @@ -0,0 +1,13 @@ +--- +ID: "fda63c49-b59d-402b-a260-99fd2c81f1bb" +Parent: "66aff2d9-d6ba-4c10-a049-9b4047c29fc8" +Template: "4d50cdae-c2d9-4de8-b080-8f992bfb1b55" +Path: /sitecore/content/Verticals/Services/Presentation/Headless Variants/Author List/Simple +Languages: +- Language: en + Versions: + - Version: 1 + Fields: + - ID: "8cdc337e-a112-42fb-bbb4-4143751e123f" + Hint: __Revision + Value: "3950ef66-c5e5-46ea-ad74-1076a22c6103" diff --git a/src/items/sxa-content/content/Verticals/Services/Presentation/Partial Designs/Author Content.yml b/src/items/sxa-content/content/Verticals/Services/Presentation/Partial Designs/Author Content.yml index 2dc8bad2..f6578791 100644 --- a/src/items/sxa-content/content/Verticals/Services/Presentation/Partial Designs/Author Content.yml +++ b/src/items/sxa-content/content/Verticals/Services/Presentation/Partial Designs/Author Content.yml @@ -22,7 +22,7 @@ SharedFields: uid="{F59395FE-244D-4421-84E9-B681C40B8633}" p:before="*" s:id="{F7BB574A-E5C1-4475-A07E-0EBF590CC50E}" - s:par="FieldNames&RenderingIdentifier&Styles&CSSStyles&GridParameters=%7B7465D855-992E-4DC2-9855-A03250DFA74B%7D&DynamicPlaceholderId=1" + s:par="FieldNames=%7B5FAAA36D-77F3-4B48-91D0-1B76F6E24A92%7D&RenderingIdentifier&Styles&CSSStyles&GridParameters=%7B7465D855-992E-4DC2-9855-A03250DFA74B%7D&DynamicPlaceholderId=1" s:ph="headless-main" /> - ID: "8cdc337e-a112-42fb-bbb4-4143751e123f" Hint: __Revision - Value: "0e6035ea-04de-4548-a3a8-d969f048fa2c" + Value: "a0c6be1e-9924-4452-acda-4d5f1577f4e9" - Language: "fr-CA" Versions: - Version: 1 diff --git a/src/sxastarter/src/assets/sass/components/_component-author-details.scss b/src/sxastarter/src/assets/sass/components/_component-author-details.scss index df1d35b4..adc2f178 100644 --- a/src/sxastarter/src/assets/sass/components/_component-author-details.scss +++ b/src/sxastarter/src/assets/sass/components/_component-author-details.scss @@ -24,4 +24,29 @@ .author-bio { font-size: 125%; } + + &-simple { + margin-top: 80px; + margin-bottom: 80px; + + @include respond-to(mobile-large) { + margin-top: $component-margin; + padding-left: $size-padding; + padding-right: $size-padding; + } + + .text-col { + max-width: 50rem; + margin-right: auto; + } + + .img-col { + img { + border-radius: var(--roundness); + width: 100%; + aspect-ratio: 1/1; + object-fit: cover; + } + } + } } diff --git a/src/sxastarter/src/assets/sass/components/author-list/_author-list.scss b/src/sxastarter/src/assets/sass/components/author-list/_author-list.scss index 3bf19e88..e37a17e8 100644 --- a/src/sxastarter/src/assets/sass/components/author-list/_author-list.scss +++ b/src/sxastarter/src/assets/sass/components/author-list/_author-list.scss @@ -80,4 +80,17 @@ object-fit: cover; } } + + &-simple { + p { + opacity: var(--author-position-opacity); + } + + img { + width: 100%; + height: 100%; + aspect-ratio: 1/1; + object-fit: cover; + } + } } diff --git a/src/sxastarter/src/components/PageContent/AuthorDetails.tsx b/src/sxastarter/src/components/PageContent/AuthorDetails.tsx index 920299e4..0c8ef573 100644 --- a/src/sxastarter/src/components/PageContent/AuthorDetails.tsx +++ b/src/sxastarter/src/components/PageContent/AuthorDetails.tsx @@ -68,3 +68,33 @@ export const Default = (props: PageBackgroundProps): JSX.Element => { ); }; + +export const Simple = (props: PageBackgroundProps): JSX.Element => { + const id = props.params?.RenderingIdentifier; + return ( +
+
+
+
+
+ +
+

+ +

+ +
+ +
+
+
+ +
+
+
+
+ ); +}; diff --git a/src/sxastarter/src/components/PageContent/AuthorList.tsx b/src/sxastarter/src/components/PageContent/AuthorList.tsx index f0bb95ab..9322a8a2 100644 --- a/src/sxastarter/src/components/PageContent/AuthorList.tsx +++ b/src/sxastarter/src/components/PageContent/AuthorList.tsx @@ -137,5 +137,47 @@ const AuthorListSlider = (props: AuthorListComponentProps): JSX.Element => { ); }; +const AuthorListSimple = (props: AuthorListComponentProps): JSX.Element => { + const id = props.params.RenderingIdentifier; + const authors = props.fields?.items?.filter((item) => item.name !== 'Data'); + const { sitecoreContext } = useSitecoreContext(); + const isPageEditing = sitecoreContext.pageEditing; + const { t } = useI18n(); + + return ( +
+
+
+ {authors?.map((author) => ( +
+
+ +
+
+

+ +

+

+ +

+
+ +
+ + {t('Read more') || 'Read more'} + +
+
+ ))} +
+
+
+ ); +}; + export const Default = withDatasourceCheck()(AuthorListDefault); export const Slider = withDatasourceCheck()(AuthorListSlider); +export const Simple = withDatasourceCheck()(AuthorListSimple); From 62bd87bd44d064a5be6ebb69948e18ed564eb37c Mon Sep 17 00:00:00 2001 From: Neli Kostadinova Date: Mon, 12 Aug 2024 11:26:48 +0300 Subject: [PATCH 2/2] authors page --- .../Verticals/Services/Home/Authors.yml | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/items/sxa-content/content/Verticals/Services/Home/Authors.yml b/src/items/sxa-content/content/Verticals/Services/Home/Authors.yml index 32556756..2446f584 100644 --- a/src/items/sxa-content/content/Verticals/Services/Home/Authors.yml +++ b/src/items/sxa-content/content/Verticals/Services/Home/Authors.yml @@ -2,7 +2,7 @@ ID: "83beea4e-5e8d-4c88-9da0-b6e2b3b421e0" Parent: "57f2e85d-d695-4e6c-8c89-947ce5443e2e" Template: "1226c3c7-2d1f-48f5-87b4-c1da459f05e5" -Path: /sitecore/content/Verticals/Services/Home/authors +Path: /sitecore/content/Verticals/Services/Home/Authors SharedFields: - ID: "1172f251-dad4-4efb-a329-0c63500e4f1e" Hint: __Masters @@ -26,18 +26,29 @@ SharedFields: id="{FE5D7FDF-89C0-4D99-9AA3-B5FBD009C9F3}"> + + Languages: - Language: en - Fields: - - ID: "b5e02ad9-d56f-4c41-a065-a133db87bdeb" - Hint: __Display name - Value: Authors Versions: - Version: 1 Fields: @@ -55,7 +66,7 @@ Languages: Value: Authors - ID: "8cdc337e-a112-42fb-bbb4-4143751e123f" Hint: __Revision - Value: "8077af42-1c7a-4de4-95f1-c71a6f798043" + Value: "28d4abcb-3de5-4467-aa1a-17feb8646234" - Language: "fr-CA" Versions: - Version: 1