Sitecore / XM-Cloud-Introduction

A repository containing the code for the MVP & SUGCON Sites, powered by XM Cloud
47 stars 47 forks source link

SUGCON 2024: Navigation Link Placeholder #455

Closed cheeto-bandito closed 3 months ago

cheeto-bandito commented 3 months ago

Description / Motivation

The ButtonLink component in the Header Navigation was hard-coded and was not reusable for other SUGCON sites. To resolve this, I've done the following:

  1. Created a Placeholder Setting named Button Link that accepts the Link component as an Allowed Control
  2. Cloned the OOTB Headless SXA Navigation component
  3. Added the Button Link placeholder setting to the Layout Service Placeholders of the Navigation component image
  4. Created a Headless Variant on the Link component named Button
  5. Created a datasource item named Header CTA
  6. Added the Link component to the Header partial design with the appropriate placeholder and datasource from step 5

How Has This Been Tested?

  1. Serialized all of my content changes
  2. Cleaned the solution
  3. Redeployed all content to my local
  4. Loaded up Experience Editor and verified that the CTA renders properly image

Types of changes

Checklist:

cheeto-bandito commented 3 months ago

Hey Chet, just reviewing this one. Seems I cannot find the Data source for the Header CTA. I checked the presentation details of the Header Partial Design and I can see it has the Link Component pointing to $site/Data folder. But as mentioned data source folder and item is missing. I wonder if I deploy the new app code now, if that will crash when it does not find the data source. I think we should have that checked in with the Code.

I've made the requested changes and serialized the /Data/Links/Header CTA single item path.