For the list data, Sitecore JSS offering "ContentList" as a field datatype. When you deploy it in Sitecore, it converts into "Treelist".
But what to do if you need "Multilist" instead of Treelist at Sitecore side?
Solution:
You have to specify "MultiList" as a string type when you define the Sitecore field definition for the component as
As you can notice here I defined "ArticleList" field as a "MultiList" datatype.
You can also set the datasource or query with this Multilist field definition as
Here I have set the datasource as a child folder "articles" of current Sitecore context item.
I hope this quick tip help you in Sitecore JSS App development.
But what to do if you need "Multilist" instead of Treelist at Sitecore side?
Solution:
You have to specify "MultiList" as a string type when you define the Sitecore field definition for the component as
{ name: 'content', type: CommonFieldTypes.RichText },
{ name: 'articleList', type: 'MultiList'},
As you can notice here I defined "ArticleList" field as a "MultiList" datatype.
You can also set the datasource or query with this Multilist field definition as
{ name: 'articleList', type: 'MultiList', source: `query:./Articles/*`, },
Here I have set the datasource as a child folder "articles" of current Sitecore context item.
I hope this quick tip help you in Sitecore JSS App development.
Nice
ReplyDeletefrtrte
ReplyDeleteThe team’s communication skills were lacking, and their ability to meet deadlines fell short. Costs were unreasonable given the end result.
ReplyDeletewebsite design studios
They made it easy to give feedback, responding quickly to requested changes. They were friendly, professional, and communicative.
ReplyDeleteweb development San Francisco
Hmm!! This blog is really cool, I’m so lucky that I have reached here and got this awesome information.
ReplyDeletewebsite design agencies
Fascinating information I haven’t been experienced such information in quite a long time.
ReplyDeleteprofessional website design companies