Submenu Endpoints¶
The Submenu endpoints provide hierarchical submenu structures in django CMS.
Note
The endpoints follow the same structure as the submenu in a template. Please refer to the documentation for more details. Get root level submenu:
{% show_sub_menu 1 %}
GET /api/{language}/submenu/
Returns hierarchical submenu structures for the specified language
Submenu information includes page titles, URLs, visibility settings, and nested relationships
This endpoint is essential for building dropdown menus, sidebar navigation, and contextual menus
Advanced endpoints allow filtering by levels, root levels, nephews, and specific paths
CMS Reference¶
Endpoints¶
List Submenu¶
GET /api/{language}/submenu/
Get the complete submenu structure for a specific language.
Response Attributes:
namespace: Application namespace (nullable)title: Menu item titleurl: Complete URL to the page (nullable)api_endpoint: API endpoint URL for the page (nullable)visible: Whether the menu item is visibleselected: Whether the menu item is currently selectedattr: Additional attributes (nullable)level: Menu level/depth (nullable)children: Array of child menu items
Path Parameters:
language(string, required): Language code (e.g., “en”, “de”)
Query Parameters:
preview(boolean, optional): Set to true to preview unpublished content (admin access required)
Example Request:
GET /api/en/submenu/?preview=true
Example Response:
{
"namespace": null,
"title": "Home",
"url": "http://localhost:8080/en/",
"api_endpoint": "http://localhost:8080/api/en/pages/",
"visible": true,
"selected": false,
"attr": null,
"level": 0,
"children": [
{
"namespace": null,
"title": "About Us",
"url": "http://localhost:8080/en/about/",
"api_endpoint": "http://localhost:8080/api/en/pages/about/",
"visible": true,
"selected": false,
"attr": null,
"level": 1,
"children": []
}
]
}
List Submenu by Levels¶
GET /api/{language}/submenu/{levels}/
Get the submenu structure filtered by number of levels.
Path Parameters:
language(string, required): Language code (e.g., “en”, “de”)levels(integer, required): Number of levels to include in the submenu
Query Parameters:
preview(boolean, optional): Set to true to preview unpublished content (admin access required)
Example Request:
GET /api/en/submenu/2/?preview=true
Example Response:
{
"namespace": null,
"title": "Home",
"url": "http://localhost:8080/en/",
"api_endpoint": "http://localhost:8080/api/en/pages/",
"visible": true,
"selected": false,
"attr": null,
"level": 0,
"children": [
{
"namespace": null,
"title": "About Us",
"url": "http://localhost:8080/en/about/",
"api_endpoint": "http://localhost:8080/api/en/pages/about/",
"visible": true,
"selected": false,
"attr": null,
"level": 1,
"children": []
}
]
}
List Submenu by Levels and Path¶
GET /api/{language}/submenu/{levels}/{path}/
Get the submenu structure filtered by number of levels and specific path.
Path Parameters:
language(string, required): Language code (e.g., “en”, “de”)levels(integer, required): Number of levels to include in the submenupath(string, required): Path as starting node for the submenu
Query Parameters:
preview(boolean, optional): Set to true to preview unpublished content (admin access required)
Example Request:
GET /api/en/submenu/2/about/?preview=true
Example Response:
{
"namespace": null,
"title": "About Us",
"url": "http://localhost:8080/en/about/",
"api_endpoint": "http://localhost:8080/api/en/pages/about/",
"visible": true,
"selected": true,
"attr": null,
"level": 1,
"children": []
}
List Submenu by Levels and Root Level¶
GET /api/{language}/submenu/{levels}/{root_level}/
Get the submenu structure filtered by number of levels and root level.
Path Parameters:
language(string, required): Language code (e.g., “en”, “de”)levels(integer, required): Number of levels to include in the submenuroot_level(integer, required): Root level to start the submenu from
Query Parameters:
preview(boolean, optional): Set to true to preview unpublished content (admin access required)
Example Request:
GET /api/en/submenu/2/1/?preview=true
Example Response:
{
"namespace": null,
"title": "About Us",
"url": "http://localhost:8080/en/about/",
"api_endpoint": "http://localhost:8080/api/en/pages/about/",
"visible": true,
"selected": false,
"attr": null,
"level": 1,
"children": []
}
List Submenu by Levels, Root Level and Nephews¶
GET /api/{language}/submenu/{levels}/{root_level}/{nephews}/
Get the submenu structure filtered by number of levels, root level, and nephews.
Path Parameters:
language(string, required): Language code (e.g., “en”, “de”)levels(integer, required): Number of levels to include in the submenuroot_level(integer, required): Root level to start the submenu fromnephews(integer, required): Number of nephew items to include
Query Parameters:
preview(boolean, optional): Set to true to preview unpublished content (admin access required)
Example Request:
GET /api/en/submenu/2/1/1/?preview=true
Example Response:
{
"namespace": null,
"title": "About Us",
"url": "http://localhost:8080/en/about/",
"api_endpoint": "http://localhost:8080/api/en/pages/about/",
"visible": true,
"selected": false,
"attr": null,
"level": 1,
"children": []
}
List Submenu by Levels, Root Level, Nephews and Path¶
GET /api/{language}/submenu/{levels}/{root_level}/{nephews}/{path}/
Get the submenu structure filtered by number of levels, root level, nephews, and specific path.
Path Parameters:
language(string, required): Language code (e.g., “en”, “de”)levels(integer, required): Number of levels to include in the submenuroot_level(integer, required): Root level to start the submenu fromnephews(integer, required): Number of nephew items to includepath(string, required): Path as starting node for the submenu
Query Parameters:
preview(boolean, optional): Set to true to preview unpublished content (admin access required)
Example Request:
GET /api/en/submenu/2/1/1/about/?preview=true
Example Response:
{
"namespace": null,
"title": "About Us",
"url": "http://localhost:8080/en/about/",
"api_endpoint": "http://localhost:8080/api/en/pages/about/",
"visible": true,
"selected": true,
"attr": null,
"level": 1,
"children": []
}
List Submenu by Levels, Root Level and Path¶
GET /api/{language}/submenu/{levels}/{root_level}/{path}/
Get the submenu structure filtered by number of levels, root level, and specific path.
Path Parameters:
language(string, required): Language code (e.g., “en”, “de”)levels(integer, required): Number of levels to include in the submenuroot_level(integer, required): Root level to start the submenu frompath(string, required): Path as starting node for the submenu
Query Parameters:
preview(boolean, optional): Set to true to preview unpublished content (admin access required)
Example Request:
GET /api/en/submenu/2/1/about/?preview=true
Example Response:
{
"namespace": null,
"title": "About Us",
"url": "http://localhost:8080/en/about/",
"api_endpoint": "http://localhost:8080/api/en/pages/about/",
"visible": true,
"selected": true,
"attr": null,
"level": 1,
"children": []
}
List Submenu by Path¶
GET /api/{language}/submenu/{path}/
Get the submenu structure filtered by specific path.
Path Parameters:
language(string, required): Language code (e.g., “en”, “de”)path(string, required): Path as starting node for the submenu
Query Parameters:
preview(boolean, optional): Set to true to preview unpublished content (admin access required)
Example Request:
GET /api/en/submenu/about/?preview=true
Example Response:
{
"namespace": null,
"title": "About Us",
"url": "http://localhost:8080/en/about/",
"api_endpoint": "http://localhost:8080/api/en/pages/about/",
"visible": true,
"selected": true,
"attr": null,
"level": 1,
"children": []
}