ThomasJSmart
Programmer
- Sep 16, 2002
- 634
Hi All
I am working on a website that has 3 languages, probably more in the future. The menus for this site are all stored in the same table, with a flag for which language it is:
The website loads all menus "where language = x"
The admin can create pages in each language separately in the cms. They can add a language X page with content that is not necessarily available in one of the other languages but we can assume that most will be available in every language.
When the user clicks one of the language flags the site should switch to that language. Normally I would just let the flag link to the homepage but in this case I want the user to switch to the same page but in the language they selected. If that page is not available in that language it would default to the index.
My question is: how to best track which pages belong together in the database?
My current ideas are:
Have a table that collects id's of pages that are matched together by the admin when they create a new page via a pull-down for each other language where they can select the page that matches it.
I hate making tables like this though as it can get very messy :/
The other option I thought of would be to have some common identifier in the menu table:
This would store a shared secondary ID between each page that belongs together, using the same pull-down method for the admin to decide this.
are there any other better ways to track which pages belong together and to match pages in the cms? please let me know if you have any.
Thank you!
Thomas
site | blog | iphones |
I am working on a website that has 3 languages, probably more in the future. The menus for this site are all stored in the same table, with a flag for which language it is:
Code:
menu_id, language, menu_title
The website loads all menus "where language = x"
The admin can create pages in each language separately in the cms. They can add a language X page with content that is not necessarily available in one of the other languages but we can assume that most will be available in every language.
When the user clicks one of the language flags the site should switch to that language. Normally I would just let the flag link to the homepage but in this case I want the user to switch to the same page but in the language they selected. If that page is not available in that language it would default to the index.
My question is: how to best track which pages belong together in the database?
My current ideas are:
Have a table that collects id's of pages that are matched together by the admin when they create a new page via a pull-down for each other language where they can select the page that matches it.
Code:
match_id langx_id langy_id langz_id
I hate making tables like this though as it can get very messy :/
The other option I thought of would be to have some common identifier in the menu table:
Code:
menu_id, identifier, language, menu_title
This would store a shared secondary ID between each page that belongs together, using the same pull-down method for the admin to decide this.
are there any other better ways to track which pages belong together and to match pages in the cms? please let me know if you have any.
Thank you!
Thomas
site | blog | iphones |