Navigation Menu
There are Numerous links in menu and if we write whole code in html then number of lines will increase a lot. So to prevent that we have created a json for the menu links so that we can loop through the array links and render our links accordingly.
You can find menu.json on the following path: "public/assets/data/menu.json"
"data": [
{
"id": 1,
"title": "home",
"mega_menu": true,
"type": "sub",
"home_banner": true,
"children": [
{
"id": 1,
"title": "design_agency",
"banner": "assets/images/demo/7.png",
"type": "link",
"path": "/home/design-agency"
},
{
"id": 2,
"title": "wedding_planner",
"banner": "assets/images/demo/12.png",
"type": "link",
"path": "/home/wedding-planner"
},
{
"id": 3,
"title": "cafe",
"banner": "assets/images/demo/13.png",
"type": "link",
"path": "/home/cafe"
},
{
"id": 4,
"title": "seo_agency",
"banner": "assets/images/demo/1.png",
"type": "link",
"path": "/home/seo-agency"
},
{
"id": 5,
"title": "charity",
"banner": "assets/images/demo/10.png",
"type": "link",
"path": "/home/charity"
}
]
},
{
"id": 15,
"title": "shop",
"mega_menu": true,
"type": "sub",
"banner_video": true,
"children": [
{
"id": 16,
"title": "shop_pages",
"type": "sub",
"children": [
{
"id": 17,
"title": "shop_drawer",
"type": "link",
"path": "/collections?layout=shop_drawer",
"badge": true,
"badge_text": "new",
"badge_color": "badge-border"
},
{
"id": 18,
"title": "left_sidebar",
"type": "link",
"path": "/collections?layout=left_sidebar"
},
{
"id": 19,
"title": "left_sidebar_2_grid",
"type": "link",
"path": "/collections?layout=left_sidebar_2_grid"
},
{
"id": 20,
"title": "left_sidebar_4_grid",
"type": "link",
"path": "/collections?layout=left_sidebar_4_grid"
},
{
"id": 21,
"title": "list_left_sidebar",
"type": "link",
"path": "/collections?layout=list_left_sidebar"
},
{
"id": 22,
"title": "list_no_sidebar",
"type": "link",
"path": "/collections?layout=list_no_sidebar"
},
{
"id": 23,
"title": "list_right_sidebar",
"type": "link",
"path": "/collections?layout=list_right_sidebar"
}
]
}
}
]
If you need to modify anything in the already made navbar you have to make changes in this file "public/assets/data/menu.json"
Adding new Links
Lets say you want to add a new link in the navigation bar, then you can do that by following the below given steps.
- add a new object in the array of navlinks containing the title, type, banner, slug, type, path and children (if any) as the keys to that object.
- Make sure that you provide the proper path in the menu.json file or else page won't render as the website won't be able to find the correct page for that path.