0

I am creating a left navigation component in sitecoreJSS (using Angular), for this I need to retrieve complete tree under specific node, and I created a left navigation template and inherited this template to existing template that I want to use items from particular templates.

I want to retrieve all the items created from these templates.

  • You should make use of a graphql query – Hishaam Namooya Dec 19 '19 at 6:13
1

You have to use graphQL to fetch any item which is not a datasource item or context item in JSS.

But with the default setup you can use graphQL to do the same, sample query to fetch all the folder items under "Home"

query RetrieveContentItems($itemPath: String = "/sitecore/content/Home") {

  rootItem: item(path: $itemPath)
  {
    children(includeTemplateIDs: "{A87A00B1-E6DB-45AB-8B54-636FEC3B5523}")
    {
      id
      name
    }
  }
}
|improve this answer|||||
0

You can create a new template(optional) with a field as multilist, set the datasource to a specific location(home node) and add condition for your template. Now you can use this field as your left navigation, where you can get title/links and other fields(if required).

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.