I’m using the “Structured Field Content” method for my menu carts to structure my content.
With <?php a::show($menus) ?> I got a nice looking array object:
i cant test it right now, but texnixe posted the following code a while back: It looks quite similar to what you are trying to archive. Btw. i am becoming hungry, menu looks very tasty
/menu
menu.txt --> create menu.yml blueprint that only allows menu-category subpages
/subpage Vorspeisen
menu-category.txt
/subpage Suppen
/subpage Hauptgerichte
Blueprint menu-category.yml
title: Menu Category
pages: false
fields:
title:
label: Titel
type: text
subtitle:
label: Subtitle
type: text
menuItems:
label: Menu Items
type: structure
style: table
fields:
title:
label: Title
type: text
description:
label: Beschreibung
type: textarea
price:
label: Preis
type: number
I support @texnixe’s idea, but I would do the next step and build a page in the panel for every menu table menu or drink one level under the menu-category, that means to build one level more, because I hate to use structure fields for this.
My suggestion means, that every “line of the menu table” (German: “Gericht/Getränk der Speisekarte”) has an own page in the panel and can be changed in the visibility by the normal panel ways.
That means that every “line of the menu table” can have added fields like the “sale time” of this line (e.g. for special lines like asparagus (German: “Spargel”), which is not availible the whole year, because of the protection of this species by law. Or like pictures, aditional tags to prevent showing this cheap produkt in the preview on the homepage and so on.
That means furthermore, that you have to adapt your templates and snippets, may be to prevent showing these deep pages, e.g. in the main menu, the html- and xml-sitemaps and to the viewers of the normal webpages of these levels, but this similarly for @texnixe’s solution.
And you can use different blueprints for eating and drinks, because drinks need something like “0,2l” as an additional information.
I’d only use subpages for each menu item, if you plan to add additional information. For just that little bit of content as in your example, I don’t think it is worth it to create separate pages.
As regards drinks, they would have a different page on the same level as menu anyway.
Seasonal dishes could have their own pages/structure fields.
But it really depends on your use case and what would be easier to handle for the users.
Must admit that I don’t understand the result. What did you do? Have you created subpages for the different categories like Vorspeisen Hauptgerichte etc. like I suggested?
It would be cool to use a bootstrap-modal (like the screenshot above) for the different menu carts.
Each section like Vorspeisen, Suppen of a menu cart is in an bootstrap-collapse to avoid to get lost (because some carts are very long).
Now, it should be possible to create, edit & delete the single courses like we already did.
What is missing are the titles for each sections like ‘Vorspeisen’, Suppen