2

I'm currently in the process of making a website for a restaurant and using Craft CMS & I'm not sure how to go about making the menu page.

It is a very complete page with a bunch of different categories of food & a bunch of items and pictures for each category. My goal is to have a subnav on the left be Sticky & have them scroll down with anchor links to the corresponding section.

I'm still relatively new with Craft CMS and wanted some opinions/tips on what the best and cleanest way of doing this would be.

Here is a wireframe so I could show you guys what I'm trying to accomplish.

  1. Have the left Nav with anchor links to the corresponding food section.
  2. What is the best technique to create those food category sections & put them into the page.

    Wireframe example of the menu page,

1

What I should do is create a category group whish should be filled with your "Food Categories". Once you've done that you could display them in your side menu. (If you show the menu on everypage make sure to include it in your _layout.html or as a new block however you like it.

For your food category section.

You could create a Channel for those. Add all the fields you need and put them in there. Don't forget to create a Category field connected to your food categories group. This way you can link an entry to the category it's supposed to go too.

If you created a couple of entries and connected them to their categories. You can display them in the big section by looping over all the entries in your Food Channel. You can grab the category by looping over the category field you made. This way you can add the coloured banner which belongs to the chosen category.

Here are some links for all this:

https://craftcms.com/docs/templating/craft.categories

https://craftcms.com/docs/categories-fields

https://craftcms.com/docs/categories

https://craftcms.com/support/entries-related-to-category

Craft CMS also has a slack community. For more detailed questions you could ask for help there. You can checkout how to join here.

https://craftcms.com/community#slack

  • Thanks a bunch Justin! I guess I have to look into categories, never had to use them before today! – mateostabio Aug 8 '17 at 0:50
  • Is it okay if I ended up making a new section structure, and inside that I made entries for every type of food. And for the left Nav I've just pulled the entry titles, and will output the entire entries in the content section on the right. Then I guess I will link them using anchor links like so <a href="#{{ entry.title }}">{{ entry.title }}</a> and on the entry content I will put <h1 id="{{ entry.title }}">{{ entry.title }}</h1> Do you think that's good and I could skip the whole categories thing? – mateostabio Aug 10 '17 at 1:47
  • @mateostabio Sounds like alot of work to me. If it works for you and it's clear for the client aswell you could stick to the plan but, in my opinion you shouldn't try to avoid working with categories as they make it alot easyer for someone else except the developer to make new related entries. They could just select a category instead of searching through the structure – Justin Dekkers Aug 10 '17 at 7:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.