Understanding Tridion Docs Table of Contents (TOC) in DXD
Tridion Docs TOC is stored in DXD as categories and keywords, representing nested levels. In DXD 11.1, there is no dedicated Tridion Docs-specific TOC GraphiQL API. However, you can retrieve the TOC using the following GraphiQL APIs:
Additionally, two GraphiQL APIs become available after installing the DXA custom model extension from DXD 11.1 installation media (udp-content-dxa-extension-assembly-11.1.0-1061-core.zip):
- sitemapStructure
- sitemapSubtree
Refer to the Tridion Docs DDWebapp module API controller for the GraphiQL TocProvider.
Example GraphiQL Queries:
- Get TOC with
categories
Graphiql API
query GetCategories($namespaceId: Int!, $publicationId: Int!)
{
categories(namespaceId: $namespaceId, publicationId: $publicationId) {
edges {
node {
...KeywordFields
children {
edges {
node {
...KeywordFields
children {
edges {
node {
...KeywordFields
children {
edges {
node {
...KeywordFields
}
}
}
}
}
}
}
}
}
}
}
}
}
fragment KeywordFields on Keyword
{
id,
itemId,
title,
itemType
taxonomyType
}
- Get TOC Sitemap Subtree No Recurse with DXA model extension
{
sitemapSubtree(namespaceId: 2, publicationId: 12343, taxonomyNodeId: "t1")
{
...TaxonomyItemFields
}
}
fragment TaxonomyItemFields on TaxonomySitemapItem
{
id
title
originalTitle
url
type
visible
description
key
abstract
hasChildNodes
classifiedItemsCount
}
- Get TOC Parent and Child level with DXA model extension
{
sitemapSubtree(namespaceId: 2, publicationId:12343 , taxonomyNodeId: "t1-k2")
{
...TaxonomyItemFields
...RecurseItems
}
}
fragment TaxonomyItemFields on TaxonomySitemapItem
{
id
title
originalTitle
url
type
visible
description
key
abstract
hasChildNodes
classifiedItemsCount
}
fragment RecurseItems on TaxonomySitemapItem
{
items
{
...on TaxonomySitemapItem {...TaxonomyItemFields}
...on PageSitemapItem {...TaxonomyPageFields}
}
}
fragment TaxonomyPageFields on PageSitemapItem
{
id
title
originalTitle
url
type
publishedDate
visible
}
In summary, these GraphiQL queries and examples serve as a guide to retrieve nested submaps from Tridion Docs TOC in DXD. Be mindful of version-specific considerations.