Jump to content

SQL join Table in Processwire


pwnewbie
 Share

Recommended Posts

I read this https://processwire.com/talk/topic/3579-tutorial-approaches-to-categorising-site-content/

Now I'm designing a German to English and vice versa table but categorized by theme. I end up doing a flat table in PW.  That is one page with following fields,

CategoryName (e.g. greetings, house, school, etc.),(text field).

GermanWord (repeater field)

EnglishWord(repeater field)

That way I can search by category (i.e.find the with that category) and the user will see German/English words is that category. Example school category might show the following words, teacher, pupil, library, etc. Is it correct to say that the page design above is equivalent to row in a classic SQL join table where in the template used by that page is the join table itself?

Link to comment
Share on other sites

It's kind of that way, but a page is always joining data, as each field's data is in a separate table, no matter how you build your structure.

But regarding the structure. This isn't the most optimal approach. According to the tutorial it would be much more flexible to have the categories as pages (mostly the title, maybe with an description) and the translations as pages, with catergory (page field), german and english (both text fields). This way you can easily update both types of entities independent of each other. I'm not sure about the scale of your project, but repeaters aren't as efficient as normal pages and lack e.g. options like the hidden/published states, which is to keep in mind as a project might grow. If you need a nice listing of categories you could use pagetables on the categories or lister/listerpro lists.

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...