We set the task of developing a similar one, but it’s impossible to approach the correct construction of such a structure. I started something in the admin panel but it doesn't quite work out at all, since the nesting of the blocks is large. Here are the sketches in the database, if you need to change the structure in the database, please give a hint. enter image description here

enter image description here enter image description here

So I don’t understand how the blocks are generated in such a way as if they are independent of each other. enter image description here

Closed due to the fact that the essence of the question is incomprehensible by the participants aleksandr barakin , Grundy , VAndrJ , D-side , Pavel Mayorov 13 May '16 at 5:58 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • Put good windows in my apartment, then okay, I will help. - Sergey
  • And it is possible to make the description to the task more meaningful, and the notion “how to make such a structure” can be interpreted as desired. What do you mean by "such"? - Alex Krass
  • Similar to this. There are 4 types of windows, each of them is divided into subtypes, and in turn, the subtypes are also divided into certain options, while in the HTML each subtype or option is generated by a separate block as if it is not connected in any way with the parent. - quaresma89

1 answer 1

When designing a database, proceed from the entities and their properties. Also, if there are any characteristics that can be changed and described separately, you need to put them in separate tables.

In this case, I see two entities, it is the frame itself and the windows that enter the frame. At the same time, a set of materials, profiles and decors can always change near the window. And the packages have their opening direction.

Although I do not know the exact conditions and you have not provided them. But if to proceed from the above, then the approximate structure of the database could look something like this:

enter image description here

As for the HTML block generation, there is most likely a logical error in some places and the site just hopes for the adequacy of the customer. For example, that he will not choose a frame in four windows and only one window.

  • Thank you very much for the advice! - quaresma89