I'm working on a restaurant site.
Each week the daily menu for the next week will be published.
I will create a CPT "Weekly Menus" for this but I was wondering if I should use a RFG for the days of the week or just have regular fields for each day (like Monday_starter / Monday_Maindish / Monday_dessert / Tuesday_starter / Tuesday_Maindish / ...)
The menu of the current week must be published on a page with a fixed url and I can't figure out how to do this when using RFG.
Using regular fields I think I can just include a view which select only the fields from the most recent published CPT.
It would also be nice to be able to show for instance the menu of the current and next date on the homepage.
Also, I'm using Elementor and this works well for all fields except for RFG it seems 🙁
(I cannot just use a regular page which is updated daily as on publication a mail must automatically send to a mailing list)
Hello and thank you for contacting the Toolset support.
I would suggest creating a "Daily Menus" custom post type instead of a "Weekly Menus" custom post type. Or you may create both and link them with a One-to-many relationship(to be able to create Daily Menus from the Weekly Menus post, on the backend).
You can then add a custom field day, to specify which day of the week. Or add a date field for the exact date of the day of the menu. You can then add your custom fields (starter, main dish, dessert).
I believe the date field will give you more flexibility for your views(homepage, or elsewhere), you can filter using the TODAY() function. Check this article https://toolset.com/documentation/user-guides/views/date-filters/
I am aware, that this will require you to publish 7 posts each week, but it will give more power on how to manipulate and display them.
And If you built a relationship between "Daily Menus" and "Weekly Menus", you will be able to create the new "Weekly Menus" post and its children "Daily Menus" posts, all from the same screen on the backend.
I hope this helps. Let me know your feedback or if you have more questions.
Hi,
As you suggested I had a look at using relationships instead.
So I created a CPT " Daily Menu", which has fields for the 3 dished (starter, main, desert) a date-field and a price field.
Then I created another CPT "Weekly Menu" and a 1-to-many relation between these 2. A weekly menu can have max 7 dailies a child)
I created a content template for the single weekmenu with a view that shows fields from the child, so that's working fine.
Question now is how can I get an RSS-feed of the Weekly Menu, showing also content of the related daily menus?
weekmenu/feed/ only shows the title of the weekly menu