We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8830
    • 98 Posts
    Hi,

    I've been using MIGX for a long time now, and it's just perfect for galleries, slideshows, sidebar boxes and such.

    I loved the flexibility of MIGX but never really understood how and where it stores the data.

    MIGXdb sounded like a better, simpler, clearer solution, so today I jumped on this wagon.

    I would really need to have some (probably really basic for you guys) questions answered, before I will feel comfortable using it.

    I tried the "gallery-management from scratch with MIGXdb"-tutorial, and I got it working.

    So here goes:

    1) Can someone explain simply where MIGX vs MIGXdb stores the data? (by data I mean the data of the rows, like image title, path, description, and so on). Maybe a simple explanation of how it's all connected (use my gallery example), from custom TV MIGXdb row -> XML Schema -> bla bla -> taking a walk around the moon -> custom database table.

    2) What is a "MIGX Package" and "MIGX Config"? Do I always need both if I want to use MIGXdb?

    3) What does the different actions in "MIGX Package manager" actually do? (Create Package, Write schema, parse Schema, create Tables, Add fields, Remove fields, XML Schema). I have a feeling that understanding the basics of these is essential. Are some related to the CMP and some to the custom database table?

    4) I have created this gallery from the tutorial, but now I want to rename it from "mygallery" to "topSlideshow". How would I do that to make sure I rename it everywhere needed (package, database, table, and so on...)

    My goal is to understand all this enough to be able to create, delete, copy, rename, modify fields, add fields, and so on. To really understand what is happening with my data.

    I'm very grateful for help.

    Thanks.

    /E [ed. note: Eminos last edited this post 11 years, 6 months ago.]
    • MIGx stores its data in the same place every TV stores its data, site_tmplvar_contentvalues, the only difference is that it stores it all as a JSON-encoded string, which needs to be parsed and processed in an output snippet.

      MIGxDB uses custom tables to store the values - hence the DB part of the name.

      Both variants have their own migx tables; migx_configs which stores the grid and form elements you specify when you create the migx TV, and a couple of other migx_ tables for storing the various config settings and elements from the Components/MIGx menu.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 8830
        • 98 Posts
        Thanks. That answers half of my qustion #1 smiley

        I took a look in the DB, and it all seems pretty simple, which is why the MIGX interface (see my questions #2 and #3) really confuses me.

        Here are two more questions:

        5) How would I do to add two new fields, let's say "Button name" and "Button URL"? Because I want a button for every gallery image. I guess I would first have to alter the XML Schema, and write that to the table? How do I do that the right way?

        6) What is the correct way to remove a field (and database column)?
          • 4172
          • 5,888 Posts
          4) I have created this gallery from the tutorial, but now I want to rename it from "mygallery" to "topSlideshow". How would I do that to make sure I rename it everywhere needed (package, database, table, and so on...)

          I wouldn't rename something, I would rather create a new one with your own package-name, table-name and classname. you can copy the xml-schema and rename all parts in it, before creating the classes and tables.

          then create a new configuration copy/paste the existing configuration and rename also the parts to your own


          5) How would I do to add two new fields, let's say "Button name" and "Button URL"? Because I want a button for every gallery image. I guess I would first have to alter the XML Schema, and write that to the table? How do I do that the right way?

          you would add a new field in your schema, read more about it here:
          http://rtfm.modx.com/display/xPDO20/Defining+a+Schema

          to add this new fields to the map-file and to your table use the tab 'Add fields'
          indexes of new fields are not autocreated, yet!

          to remove a field from your table, you would remove it from the schema and use the tab 'remove fields' to remove them from your table, this will also create a new map-file



            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 8830
            • 98 Posts
            Thank you.
            I did some trial and error and got a hang of it.
            I have more to learn, but now I know enough to start using it in production.

            Here is one more:

            To create an on/off switch for the gallery, is the best way to create a separate checkbox-TV, or is there a way to integrate a fancy little button into the action buttons of the MIGX-TV it self (together with "Add Item")?
              • 4172
              • 5,888 Posts
              it is be possible to create custom-buttons with custom-handlers (javascript-functions)
              by creating a custom-grid-config-file either in your package-directory under yourpackage/migxconfigs/grid/grid.config.inc.php

              or under migx/configs/grid.yourconfigname.config.inc.php
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!