Drupal Content Type (Restaurant) Design

I have one type of content. For each restaurant I would like to write down their menu.

Sample data will look like this:

The drinks

  • Coke $ 4.99
  • Mineral water $ 2.99

Cocktail

  • Blue lagoon

    (X combined with Y, etc.)

  • Red sapphire, $ 9.99

    (Another X mixed with blah)

Pasta

  • Classic Bologna Style $ 13.69

    (pasta of your choice mixed with our homemade dishes of Bologna sauce)


As you can see, the menu consisted of several components: categories, menu names, descriptions, prices. It would also be great if we could also rearrange the categories (some restaurants prefer their drinks to be displayed in front of them, while others prefer the opposite).

  • How would you recommend content type design?
  • If I use the node link, is there a simple way / module allowing me to edit the menu directly from the restaurant edit form? (Perhaps some additional bookmarks for the menu)
+6
drupal drupal-6 cck
source share
4 answers

Type of content RESTAURANT. Fields for the company name, company address, phone, fax, website, email, chat, twitter, business owner, business contacts (e.g. manager), restaurant description, logo and google map link (or implementation of location modules and gmap) etc. Perhaps use the five-star module to enable user ratings in restaurants.

The ideological taxonomy of FOOD (you need a module for this). Product categories are drinks (alcoholic, nonalcoholic, etc.), soups, salads, breakfasts, lunch, dinner, desserts, dishes, sandwiches, seafood, etc.

Content Type FOOD. Fields for the node reference field for the RESTAURANT name so that their menu is properly built and organized, iterative FOOD taxonomy selection, product name (McRib, Whopper, Bloomin Onion, etc.), prices, preparation options (medium, well-made, and etc.), the food product and supplements that can be combined with this dish should either be the selected list options, or node links to other types of food contents (mashed potatoes or baked potatoes with this?)

As for images, use imagecache to create several different usable sizes for all photos, so you can create thumbnails, medium-sized images, and full-size gorgeous photos of dishes.

A CSS rendering that looks like a menu. Look at national restaurant sites like Chilis.com to see how they do it. Provide links to the menu of food taxonomy terms for each restaurant and the types of restaurants with open filters so that users can easily find restaurants by type, location, star rating, etc.

Sounds like a fun project. I would like a case study to be published when you are done.

+4
source share

The way I do this is likely to be as follows:
Notice I'm used to developing Drupal, so I could do a lot of these things pretty quickly since I did something similar recently. This may not be the best choice for you.

  • In the module, I would create two types of content for this, a restaurant and menu_item.
  • The restaurant is likely to be just a heading and another field that I would use for menu item types. I’m not sure how I will do it, it depends a little on what the future of the project will be. I could choose not to do the type of content in the Restaurant or not do anything special, and create a table solely for organizing the types of menu items.
  • Most types of contents of menu items can be done using CCK, but I would probably create tables and custom fields to arrange them (this is what I did several times, so I have a snippet to create js dragable ordering as CCK to arrange fields ) I could also choose the prices myself if I need to better control in different cases, for example, to make exchange settlements, etc.
  • For categories that I would use taxonomy (using a taxonomy provides many additional bonuses such as SEO).
  • I would use the node link to bind menu items to any menu in which they should be.
  • The remaining fields of the menu items are just text fields that CCK handled very well.
  • I would use node_api to retrieve menu items for restaurant nodes, so the menu will be displayed in the node restaurant using the thematic menu (if this is the main function, otherwise I will make a tab for the menu and save the restaurant information in the node view).
  • Using some form_alter, I would create an ordering system that connects to any system that I choose to organize categories.
  • I can allow administrators to reorder the menu items themselves on the node screen or create a tab for it. Depends on what the client wants.

This is a bit complicated developer since many of these things need to be encoded. You could go very far using cck and views, but I would prefer to create a module for this. The reason is that if the client wants it to change after six months or appear with additional features, I could very quickly implement it. Integration with cck and views can be very complex and time consuming, so using a little extra time will now make it much more flexible and extensible. I also did different things that have some common reasons, so I could use C / P a lot of code that I know well, and just adjust it here and there for some of these things. This is also partly the reason for me going this route, since using cck and views alone will not save me so much time anyway

+3
source share

I had to do something very similar to this. I solved it with panels, views and cck. I created a node type of 'restaurant' and a node type of 'menu_item'. menu_item taxonomy is set using a specific dictionary. I used panels to display the menu for the restaurant / menu name paths, then views + cck to show items in the menu (I used node links for restaurant links). then I grouped the view by taxonomy: the term field.

+1
source share

The first idea I had to do could be the following:

  • Food content indicating: name (title), description (body) and price
  • Restaurant Content Type with Multiple Node-Reference Fields
  • A dictionary related to food with terms such as drinks, cocktails, pasta, .. (and I'm sure there is a module that allows you to determine taxonomy weights)

This way you can store your data.

For the displayed part, you can use:

  • (best approach) a custom node -restaurant.tpl.php that creates a formatted page indicating the product category, classified by taxonomic term (I'm sure you have direct access to the link nodes via template variables .. I'm going to check this and inform you)
  • (can be done through the admin panel). View in a block placed in the "content" area, showing the link nodes formatted as a table, grouped by taxonomy term in the "Product Category" dictionary. You can get the current node nid (used for filtering) with arguments.

I recommend the first option, since it is more standards compliant, faster and can avoid some possible problems that may arise from views + block path.

+1
source share

All Articles