Replies: 2 comments 4 replies
-
Hi @thany ! To walk through a couple of points:
These are standard fields, it's expected they are added. We can probably drop adding displayName, but items in Sitecore do require a name and a template. Manifest data can be used for disconnected mode, and it can be deployed to a Sitecore instance - and JSS won't be able to create items without a name or a template.
Right! The whole manifest system is tightly tied to Sitecore's data model with items, fields, templates etc. Different field types work differently (single-line text would be processed differently, to, say, multilist). So when you specify a field type in
you need to refence a known field type so that Sitecore or manifest API would know how to parse it. From your description I believe you need to have a data source for the Breadcrumb component, that has a few subitems with href and title data. So the definition you need would look kind of like this:
where the id fields are the IDs of items under /data/content, located it yml/json definitions. |
Beta Was this translation helpful? Give feedback.
-
Closing this due to inactivity. |
Beta Was this translation helpful? Give feedback.
-
Description
So in
/data/routes/en.json
I've added the data that is supposed to come from Sitecore:And then I've created a definition for this component in
/sitecore/definitions/components/Breadcrumb.sitecore.ts
:When I inspect what's being injected into my Breadcrumb component, it is nowhere near the json I put there. It's the correct number of items, for some reason, but each item only has:
Which is not correct. Not only is my data missing, it has also magiced up more data that I mustn't have in my component. We shouldn't be injecting superfluous extra data into anywhere - who knows what will happen. But more importantly, where's my data??
I've also tried wrapping each object into a
value
, I've tried everyCommonFieldType
. It always produces these weird objects with properties I never asked for. I even tried adding a template:Next to the component definition. Because idunnolol I have no idea what I'm doing because there's no full reference to JSS. I feel like I'm flying blind without any type of proper documentation that isn't an arm-grabbed collection of examples and loosely-described somethings.
So how do I deal with this? Where and how do I tell JSS to return those breadcrumb objects that I specified in en.json? Clearly it reads that file, or it wouldn't know to inject the correct number of items.
It's working fine for standard item types, I'll have you know. So there doesn't seem to be a broader issue with our setup.
Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions