Jump to content

Create a Master Detail table at Processwire


Marvin
 Share

Recommended Posts

Hello, excuse me
I'm new at processwire, i want to ask about a master detail system (Inheritance system) using a processwire. Can we create a Inheritance table using a processwire, and how we create it? Thank you for the help

Link to comment
Share on other sites

8 hours ago, Marvin said:

master detail system

I’m only aware of this term in the realm of UI design. If that’s what you mean, ProcessWire will not get in your way implementing such a user interface, since it’s very output agnostic.

8 hours ago, Marvin said:

Inheritance table

It’s not clear to me what you’re trying to do. Do you mean this? https://en.wikipedia.org/wiki/Single_Table_Inheritance

ProcessWire’s data model doesn’t involve inheritance, if that’s what you mean? You can get a pretty good idea of PW’s database strategy by looking at the tables of an existing PW installation.

  • Like 1
Link to comment
Share on other sites

Hi @Jan Romero,

Thanks for the feedback

14 hours ago, Jan Romero said:

It’s not clear to me what you’re trying to do. Do you mean this? https://en.wikipedia.org/wiki/Single_Table_Inheritance

Yes, i mean i'm try to create one table at database, that will be a parent table, and on table again that will be a child table and the value of child table is a detail from parent table, and they have a inheritance relationship.

14 hours ago, Jan Romero said:

ProcessWire’s data model doesn’t involve inheritance, if that’s what you mean? You can get a pretty good idea of PW’s database strategy by looking at the tables of an existing PW installation.

Hmm, so i can't do it with a processwire? So if i have a data, like for example sell and buy transaction, that has a invoice number and so many items, what can i do, for it? I mean can i, create a website using a processwire with a data like that? Thank you very much
NB : Sorry if you can't understand with my question my english not well enough ?

Link to comment
Share on other sites

Hi @Marvin, you can definitely have all kinds of relationships between pages in ProcessWire. The term “Page” is slightly misleading because it can imply a close connection to a web-page in your front-end. Instead, in object-oriented terms, you can think of pages as objects and templates as classes. To model the relationships between pages you can use page fields and the hierarchy of the page tree (a page will always know its children and parents).

  • Like 1
Link to comment
Share on other sites

Hi @Jan Romero,

Thanks for replying, sorry my late reply.

Oh i see now, but i still confuse about something, i try to learn with trying make some pages, template, and fields at processwire, when i create a templates, theres a menu to import fields from antoher templates, how it works? I mean i try to import some fields from a template call theme_song, and at theme_song has a field, theme, and have value like Christmast, Easter, and etc. When i import the field from theme song to another template, is the value will import it too? Thank you

Link to comment
Share on other sites

No, the values are not imported. It only connects the Fields of the chosen Template to the current Template as well. A Field can be used by multiple Templates. For example you might have a website that showcases a lot of products and also has a blog. For this you could make a Template “product” with Fields for price, dimensions and so on, as well as of course a Field called “title” and a textarea Field called “body” for the product name and a description. Now in your “blog” Template you could use “title” and “body” as well. You can even change some Field settings depending on the Template.

  • Like 1
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

×
×
  • Create New...