By using a link list, you can easily add related links to a page. In this article, we will check the maximum number of items that can be used in this link list.
Check the upper limit of the list of links to be used in LinkList
XM CloudHeadless SXAPublished: 2024-09-18
Confirmation of link list operation
First, create a new link list on the CMS side and create a list of links. In this case, we created a list containing 15 linked lists.
When this is actually placed on the page, it will appear as follows.
I have created 15 items, but only 10 are shown.
Problem-solving
Let's see how this link list works. The Rendering definition for this link list is /sitecore/layout/Renderings/Feature/JSS Experience Accelerator/Navigation/LinkList.
You can see that GraphQL is defined in this item to look at the item children under the item of the specified data source. The results of this GraphQL query, as seen in Postman, are as follows.
Thus, by default, the standard setting is to retrieve 10 child items. To increase this number, add the query first: 20 to get more than the standard number of data.
query TitleQuery($datasource: String!, $language: String!) {
datasource: item(path: $datasource, language: $language) {
children (first: 20){
results {
field(name: "Link") {
link: jsonValue
}
}
}
field(name: "Title") {
title: jsonValue
}
}
}
When run in Postman, we now have 15 pieces of data.
Reflecting on the Environment
Applying the query that worked above to the items in the Link List, 15 items are now displayed when accessing the page we just placed.
Summary
We can implement this in the form of a GraphQL definition for rendering, retrieving the data, and displaying it on the page, as we did before when creating the breadcrumb list. In this case, we used Postman to check the data acquisition and made changes to it. In this case, we used Postman to check the data acquisition, and only needed to change that part.