selectiontype
tree
selectiontype
treeWhen sending a request to the Tweakwise API, you can indicate the active category using the cid parameter. This determines the context in which merchandising rules and facet configurations are applied.
By default, the immediate child categories of the selected category are returned.
When using the selection type tree for facets, you can enable a more advanced category display structure that also displays siblings and children of the active category.
To enable this extended behavior, you must pass the full category path in the cid parameter. This is necessary because a category can have multiple parents in Tweakwise's flexible category structure.
Suppose your category structure is:
Root (id: 1000)
└── Clothing (id: 1001)
└── Shirts (id: 1005)
└── Dresses (id: 1007)
└── Sweaters & Hoodies (id: 1004)
If you provide ?cid=1000-1001
in your request, the API will return:
- The siblings of Clothing
- Mark Clothing as the selected attribute
- The children of Clothing, including Shirts and Dresses
This approach allows the client to construct a breadcrumb-like navigation path while maintaining full context, even in cases where categories exist under multiple parent branches.