Menus
Query parameters
depth_heightinteger · min: 1RequiredExample:
Number of levels to retrieve from the starting point.
- Value of 1 retrieves only the immediate children
- Value of 2 retrieves children and grandchildren
- Combined with start_level to define the depth range
- Example: start_level=0, depth_height=2 retrieves levels 0-1
2parentstring · uuid · nullableOptionalExample:
UUID of the parent menu item to start generation from.
- When provided, generates children of this parent
- Overrides MENU_DEFAULT_PARENT_UUID setting
- Cannot be used with sibling parameter
- If parent not found, returns empty array
- Null value allows root-level generation
550e8400-e29b-41d4-a716-446655440000siblingstring · uuidOptionalExample:
UUID of a menu item to generate siblings for.
- Generates items at the same level under the same parent
- Useful for horizontal navigation or related sections
- Cannot be used with parent parameter
- If sibling not found, returns empty array
660e8400-e29b-41d4-a716-446655440001start_levelintegerOptionalDefault:
Starting depth level for menu generation (0-based, excluding root).
- Default: 0 (top-level menu items)
- Level 0 = first visible level
- Level 1 = second level, and so on
- Combined with depth_height to define range
- If start_level > 0 and no parent determinable, returns empty array
0Example: 0include_parentbooleanOptionalDefault:
Whether to include the parent node in the results.
- When true, parent item is added to the end of the array
- Useful for breadcrumb trails or showing context
- Only applies when parent parameter is specified
- Parent must be visible (visible=true)
falseExample: falserequest_pathstringOptionalExample:
Current page URL path for context-aware menu highlighting.
- System finds menu item matching this URL
- Selected item and its ancestors marked with selected=true
- Falls back to PrettyUrl mapping if direct match not found
- Used for "you are here" navigation indicators
- Example: "/category/electronics/laptops/"
/category/electronics/laptops/selectedstring · uuidOptionalExample:
UUID of the explicitly selected menu item.
- Directly specifies which item is currently active
- Takes precedence over request_path
- Selected item and ancestors marked with selected=true
- Useful when URL doesn't directly map to menu structure
770e8400-e29b-41d4-a716-446655440002Responses
200
Successfully generated menu structure
application/json
400
Validation error in request parameters
application/json
get/menus/generate/
GET /menus/generate/?depth_height=2 HTTP/1.1
Host: sandbox.akinon.com
Accept: */*
{
"menu": [
{
"label": "Electronics",
"url": "/category/electronics/",
"level": 0,
"pk": "550e8400-e29b-41d4-a716-446655440000",
"sort_order": 0,
"path": "00010001",
"parent_pk": null,
"parent": null,
"generator_name": "menu_item",
"extra_context": {
"attributes": {
"category_id": 123,
"icon_class": "fa-laptop",
"badge_text": "New"
},
"numchild": 5
},
"selected": true
},
{
"label": "Laptops",
"url": "/category/electronics/laptops/",
"level": 1,
"pk": "550e8400-e29b-41d4-a716-446655440001",
"sort_order": 1,
"path": "000100010001",
"parent_pk": "550e8400-e29b-41d4-a716-446655440000",
"parent": null,
"generator_name": "menu_item",
"extra_context": {
"attributes": {
"category_id": 124,
"featured": true
},
"numchild": 3
},
"selected": true
},
{
"label": "Smartphones",
"url": "/category/electronics/smartphones/",
"level": 1,
"pk": "550e8400-e29b-41d4-a716-446655440002",
"sort_order": 2,
"path": "000100010002",
"parent_pk": "550e8400-e29b-41d4-a716-446655440000",
"parent": null,
"generator_name": "menu_item",
"extra_context": {
"attributes": {
"category_id": 125,
"bestseller": true
},
"numchild": 2
},
"selected": false
},
{
"label": "Headphones",
"url": "/category/electronics/headphones/",
"level": 1,
"pk": "550e8400-e29b-41d4-a716-446655440003",
"sort_order": 3,
"path": "000100010003",
"parent_pk": "550e8400-e29b-41d4-a716-446655440000",
"parent": null,
"generator_name": "menu_item",
"extra_context": {
"attributes": {
"category_id": 126
},
"numchild": 4
},
"selected": false
},
{
"label": "Clothing",
"url": "/category/clothing/",
"level": 0,
"pk": "550e8400-e29b-41d4-a716-446655440010",
"sort_order": 4,
"path": "00010002",
"parent_pk": null,
"parent": null,
"generator_name": "menu_item",
"extra_context": {
"attributes": {
"category_id": 130,
"seasonal": "winter"
},
"numchild": 6
},
"selected": false
},
{
"label": "Men",
"url": "/category/clothing/men/",
"level": 1,
"pk": "550e8400-e29b-41d4-a716-446655440011",
"sort_order": 5,
"path": "000100020001",
"parent_pk": "550e8400-e29b-41d4-a716-446655440010",
"parent": null,
"generator_name": "menu_item",
"extra_context": {
"attributes": {
"category_id": 131
},
"numchild": 4
},
"selected": false
},
{
"label": "Women",
"url": "/category/clothing/women/",
"level": 1,
"pk": "550e8400-e29b-41d4-a716-446655440012",
"sort_order": 6,
"path": "000100020002",
"parent_pk": "550e8400-e29b-41d4-a716-446655440010",
"parent": null,
"generator_name": "menu_item",
"extra_context": {
"attributes": {
"category_id": 132,
"trending": true
},
"numchild": 5
},
"selected": false
}
]
}Query parameters
itemstring · uuidRequiredExample:
UUID of the menu item to generate breadcrumb trail for.
- Must be a valid UUID of an existing menu item
- System retrieves this item and all its ancestors
- Ancestors are items from root to this item (excluding root node)
- If item not found, returns empty array
- Example: "550e8400-e29b-41d4-a716-446655440001"
550e8400-e29b-41d4-a716-446655440001generator_namestringRequiredExample:
Name of the generator to use for breadcrumb generation.
- Must match a registered generator in MENU_RENDERER_CONFIG
- Default/standard generator: "menu_item" (MenuItemModelGenerator)
- Generator must implement generate_breadcrumb_items method
- Invalid generator name returns 400 validation error
- Custom generators can be added for specialized breadcrumb logic
menu_itemResponses
200
Successfully generated breadcrumb trail
application/json
400
Validation error in request parameters
application/json
get/menus/generate_breadcrumb/
GET /menus/generate_breadcrumb/?item=550e8400-e29b-41d4-a716-446655440001&generator_name=menu_item HTTP/1.1
Host: sandbox.akinon.com
Accept: */*
{
"menu": [
{
"label": "Electronics",
"url": "/category/electronics/",
"level": 0,
"pk": "550e8400-e29b-41d4-a716-446655440000",
"sort_order": 0,
"path": "00010001",
"parent_pk": null,
"parent": null,
"generator_name": "menu_item",
"extra_context": {
"attributes": {
"category_id": 123
},
"numchild": 5
},
"selected": false
},
{
"label": "Laptops",
"url": "/category/electronics/laptops/",
"level": 1,
"pk": "550e8400-e29b-41d4-a716-446655440001",
"sort_order": 1,
"path": "000100010001",
"parent_pk": "550e8400-e29b-41d4-a716-446655440000",
"parent": null,
"generator_name": "menu_item",
"extra_context": {
"attributes": {
"category_id": 124
},
"numchild": 3
},
"selected": false
}
]
}Last updated
Was this helpful?

