I'm working on a Sitecore XM Cloud project and we're creating front-end react components in Next.js. We're using the Sitecore Next.js JSS SDK for rendering the component data. That said, if we have a component for a Banner, which contains a Title, Description, PrimaryCTA, and SecondaryCTA fields, the CTA's are not editable in either Pages or Experience Editor.
From both Pages and Experience Editor, I can click the Title or Description and edit the text right where it sits. It also surrounds the field with a border to show it's actively being edited. If I view the source, I can also see that the field is surrounded by extra markup from Sitecore to indicate the field is editable. I do not see that same markup surrounding any links. I will try to attach a video for reference.
I've included some screenshots... In the last one, with the props being passed to the component, it should usually contain an letting you know it's editable... this does not happen, but you can also see that the "editable" prop is true.
Update We are rendering the the CTA links as follows:
import { Link as SitecoreLink } from '@sitecore-jss/sitecore-jss-nextjs';
if (field) {
return <SitecoreLink field={field} className={classNames} />;
}
We've removed all front-end logic, checks, css, everything so it is just rendering a Sitecore Link using the sitecore-jss-nextjs Link component as shown above.
I'm hoping it's a setting somewhere, but I am un-sure. Any help would be greatly appreciated!
field
?field
is the entire Sitecore field... It gets passed to the component. We setup ourfields
object in a component manifest, we add the component to the component factory and then that component receives afields
object. that fields object will contain all the fields for the component, so fields.Title, fields.Description, fields.PrimaryCTA. So to your question,field
is the PrimaryCTA field.