Search code examples
phpmysqldynamic-datameta-tags

Where to store page titles and meta descriptions of subpages?


For the website I work on, all page data is in database (page title, meta tags, content), and I store all that in one table.

Now, I have a page "products", which has a number of sub-pages (each representing a different product).

My question is, what is the best place for storing title and meta tags of sub-pages? I thought of simply adding these columns to "products" table, but it somehow feels wrong

(having for example "page_title" in two different tables).

Any totally different, wiser way to do it is also welcome.

Thanks.


Solution

  • You could have one table for pages (including products) and another table for storing sub-pages relationships (i.e., product X is a subpage of page Products).