✍️ Objective - To integrate dukaan categories data with the category cards we have created so far
Let's go back to our layout.html file, earlier it was just hardcoded categories, we will now display real categories from our store using Nunjucks.
The categories data of our store comes from a variable called DUKAAN_CATEGORY_LIST. It's a list of categories, for now we just need the category name and category image.
You can find a sample data of it and all other available variable list here.
In this Nunjucks template, we use a for loop to iterate over the DUKAAN_CATEGORY_LIST variable and create a category card for each item. We use the {{ }} syntax to insert the category name and image URL from the data.
You can deploy the change, you can now see your store category data visible in the homepage.
🎉 Awesome, you just displayed your store categories in your own custom theme. You can do more changes as per your requirement, to read more about the data which Dukaan makes accessible using Nunjucks read about Dukaan Data.