mxst
October 5, 2022, 4:16pm
1
Hey everyone,
I was wondering how I would add addon items to a restaurant menu.
The Restaurant menu | Kirby CMS is pretty straight forward but we have extra toppings for example.
I would love to represent something like this:
Base Greek Salad .... 10,00 €
> additional Feta .. +2,00 €
So does anyone have an idea on how to add an addon-item to the structure ?
~ Max
tojai
October 5, 2022, 4:44pm
2
Hey there,
I have no idea how many addon-items you have. Maybe it would be best to setup a separate item (e.g. Add-ons) within the CMS containing all the addon-items, to which you could refer to as a page & go from there.
So the dish-structure would look like this:
label: Dishes
type: structure
fields:
dish:
label: Dish
type: text
width: 1/4
description:
label: Description
type: text
width: 1/4
price:
label: Price
type: number
before: €
step: 0.01
width: 1/4
addon:
label: Add-on
type: page
query: site.find("addons")
width: 1/4
And the blueprint for the addon.yml would look like this:
title: Add-on
fields:
name:
label: Name
type: text
price:
label: Price
type: number
before: €
step: 0.01
width: 1/4