Contao-Camp 2024
Ergebnis 1 bis 8 von 8

Thema: (solved) About "child table" BO integration

  1. #1
    Contao-Nutzer
    Registriert seit
    07.11.2012.
    Beiträge
    106

    Frage (solved) About "child table" BO integration

    Hi everyone,

    When creating an input mask, one can choose nothing, standalone or child table for back-office integration. No problem with standalone. But how does child table work ? How can we add, modifiy or suppress datas when child table ? is it possible to manage its datas from a linked MM (ie add new tags in a tag attribute or new items in a select attribute) ?

    Thanks for your explanations.
    Geändert von Charled (30.09.2022 um 00:48 Uhr)

  2. #2
    Contao-Urgestein Avatar von zonky
    Registriert seit
    19.03.2010.
    Ort
    Berlin, Rdf
    Beiträge
    9.682
    User beschenken
    Wunschliste

    Standard

    EN:

    Phuu to explain this briefly is not so easy...

    MM offers different possibilities to create relations.

    For the typical relations of a single selection (1:n) or multiple selection (m:n) you first create your own (Meta)Models e.g. "department" and in the (Meta)Model "employee" you create the attributes select or tags for the relations. Both attributes can create relations to MM tables as well as to Contao tables and can handle multilingual MM tables automaticaly.
    Tip: create your " helper tables" first - then they are already there when you create the attributes with the links in the "main table" ;-)

    As a further relation, there are the child tables. If this is selected in the input mask and the setting "Parent element available", there is a new icon in the list of items of the parent table which leads to the list of children. In the child table, the items are automatically linked to the parent table via pid. This is analogous to the typical structure of Contao e.g. between the news archive and the news items.

    Furthermore, there are the variants. Here relations are built up within a table via the columns varbase and vargroup. Here the "children" are limited to one sublevel - all attributes that are not selected as "variant" automatically update their values from the parent element to all child elements.

    Finally, there is the hierarchical structure, for example, if you want to build something analogous to the page structure of Contao.


    ~~~~~~~~~~~~~~~~~~~~~~~~~~

    DE (ggf. auch für die Gruppe interessant):

    MM bietet verschiedene Möglichkeiten Relationen anzulegen.

    Für die typischen Relationen einer Einzelauswahl (1:n) oder Mehrfachauswahl (m:n) legt man erst eigene (Meta)Models an z.B. "Abteilung" und in dem (Meta)Model "Mitarbeiter" legt man die Attribute Select bzw. Tags für die Verknüpfungen an. Beide Attribute können Relationen sowohl zu MM-Tabellen als auch zu Contao-Tabellen aufbauen und kommen mit mehrsprachigen MM-Tabellen automatisch zurecht.
    Tipp: lege erst Deine "Hilfstabellen" an - dann sind die schon da, wenn Du bei der "Haupttabelle" die Attribute mit den Verknüpfungen anlegst ;-)

    Als weitere Relation gibt es die Kind-Tabellen. Wenn diese in der Eingabemaske ausgewählt ist und die Einstellung "Elternelement vorhanden" ist bei der Liste der Items der Elterntabelle ein neues Icon welches zur Liste der Kinder führt. In der Kindtabelle sind die Items automatisch über pid mit der Elterntabelle verknüpft. Das ist analog dem typische Aufbau von Contao z.B. zwischen News-Archiv und den News-Beiträgen.

    Weiterhin gibt es noch die Varianten. Hier werden Relationen innerhalb einer Tabelle aufgebaut über die Spalten varbase und vargroup. Hier sind die "Kinder" auf eine Unterebene begrenzt - alle Attribute die nicht als "variant" ausgewählt wurden, aktualisieren automatisch ihre Werte vom Elternelement auf alle Kindelemente.

    Als letztes gibt es noch den hierarchischen Aufbau z.B. wenn man was analog der Seitenstruktur von Contao aufbauen möchte.

  3. #3
    Contao-Nutzer
    Registriert seit
    07.11.2012.
    Beiträge
    106

    Standard

    Thanks Zonky for these detailed explanations. I didn't find them in the documentation. I'll make tests to understand better.

  4. #4
    Contao-Urgestein Avatar von zonky
    Registriert seit
    19.03.2010.
    Ort
    Berlin, Rdf
    Beiträge
    9.682
    User beschenken
    Wunschliste

    Standard

    Zitat Zitat von Charled Beitrag anzeigen
    I didn't find them in the documentation.
    The support of the manual with articles or money is rather modest...
    see https://community.contao.org/de/show...l=1#post388357

  5. #5
    Contao-Nutzer
    Registriert seit
    07.11.2012.
    Beiträge
    106

    Standard

    Hi,

    I've just tested "Child table". This works well but I have a suggestion. I will find more intuitive if the button to mange the entries in the child table should be in the input screen. For example at the end of the dropdown list "Manage list".

    Thanks.

  6. #6
    Contao-Urgestein Avatar von zonky
    Registriert seit
    19.03.2010.
    Ort
    Berlin, Rdf
    Beiträge
    9.682
    User beschenken
    Wunschliste

    Standard

    Hi,

    that the access to the children is done via an icon in the parents list is Contao standard - see e.g. News, Events etc. on.

    However, a representation in the input mask is still possible - although with some programming. You can insert the widget "JustTextWidget" as justlongexplanation in the mask at any position and output any HTML content in the widget. With this you can also include the list of child elements including button "New creation".


    screenshot_001.jpg

  7. #7
    Contao-Urgestein Avatar von zonky
    Registriert seit
    19.03.2010.
    Ort
    Berlin, Rdf
    Beiträge
    9.682
    User beschenken
    Wunschliste

    Standard

    Zitat Zitat von Charled Beitrag anzeigen
    Hi,

    I've just tested "Child table". This works well but I have a suggestion. I will find more intuitive if the button to mange the entries in the child table should be in the input screen. For example at the end of the dropdown list "Manage list".

    Thanks.
    I read through your text again after my hollidays - I am no longer sure if I had understood it correctly. Can you "build" a screenshot to make clear how or at what point you mean?

  8. #8
    Contao-Nutzer
    Registriert seit
    07.11.2012.
    Beiträge
    106

    Standard

    I'll do that when having a few time...

Aktive Benutzer

Aktive Benutzer

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)

Lesezeichen

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •