Jump to content

Develop a CMS with categories and subcategories in the database.


Recommended Posts

This is being planned, and will have it down on paper for the time being. Actually, the question is not how to set up the database's rows and columns, because I reckon that is the usual way to do it. If it isn't, shout it out. It's when it comes to inserting data, extracting data that it gets a bit confusing. This is a page that is supposed to be about food. E.g. dishes as a category. Or imagine dishes as a topic where there are different dishes such as from different countries. These must then be collected on the food dish from the country that is indicated where the food dish originates, etc., and there may be several subcategories. What is the best way to solve this?
This is what I came up with so far. There will probably be more later. Just give me some time so I can get started.

Since the last time, my body and I have been on quite a journey. In October 2023 I traveled to Thailand to be there until March 2024. In January 2024 I got food poisoning, and this meant that I was bedridden in the hotel for 2 months. Everything I ate and drank went down into my stomach and returned immediately. Obviously, this resulted in severe dehydration and nutrient absorption. This led to kidney failure and nerve damage throughout the body. I have been and am still seriously ill and am still in a wheelchair in a nursing home. My feet and legs as well as fingers are numb and my fingertips are numb and half numb. That's why I haven't programmed for almost half a year. I also haven't been here on the PHP Freaks forum in as long. As I said, I'm not quite well yet, but I'm getting better and better, and a nerve injury takes a long time to heal.

Link to comment
Share on other sites

Suggestion: forget categories and use tags. Same basic concept, but while categories are typically hierarchical in nature, tags are more free-form. Then you can tag each dish with whatever countries, cultures, ingredients, allergens, whatever you want.

If you haven't seen them before, there's also the "booru" concept of tag namespaces that you can add on top. For example, "Norway" can be a plain tag, or you can namespace it to "country : Norway". "Scandanavian" could be "region: Scandanavia". Apply namespaces where it makes sense, don't where it doesn't. Namespaces would allow you to do things like require that each page be given a country/region tag more easily, too.

Link to comment
Share on other sites

11 hours ago, requinix said:

Suggestion: forget categories and use tags. Same basic concept, but while categories are typically hierarchical in nature, tags are more free-form. Then you can tag each dish with whatever countries, cultures, ingredients, allergens, whatever you want.

If you haven't seen them before, there's also the "booru" concept of tag namespaces that you can add on top. For example, "Norway" can be a plain tag, or you can namespace it to "country : Norway". "Scandanavian" could be "region: Scandanavia". Apply namespaces where it makes sense, don't where it doesn't. Namespaces would allow you to do things like require that each page be given a country/region tag more easily, too.

 

Requinix, i dont know if this a good solution or not. I don't understand what you mean with a tag system. Does it mean to mark some specific image, text, file or directory or something?

Is this controlled by a config.php file?

Link to comment
Share on other sites

You've never seen a tagging system before?

Think of them as categories, except you can have as many as you want without restrictions. In a way, this thread is in the "PHP Coding Help" category, and that means it can't be part of the "MySQL Help" category at the same time. But if this forum used tags instead, this thread could be tagged as "php" as well as "mysql" and "database design" and "cms". (And actually it can, but people rarely use tags for their threads.)

There's no way you haven't seen tags before. Maybe you just didn't realize what they were... Pick more or less any modern blog, look through its posts, and you'll probably see it using tags instead of (or maybe in addition to) categories.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.