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

    I'm having some issues using multiple Migx TVs. I am creating a discography page and want to easily enter in: Title, Album artwork, and a list of songs. I created a 2nd Migx TV for the list of songs and embedded it within my initial Migx TV. And it kinda works. I am able to put in all the info


    The problem is in the preview of the information. The list of songs is just shown as a string.


    My main TV is called Record:

    FormTabs: [
    {"caption":"Album","fields": [
    {"field":"title",
    "caption":"Title"
    },{
    "field":"artwork",
    "caption":"Album Artwork",
    "inputTV":"image"
    },{
    "field":"songs",
    "caption":"Songs",
    "inputTV":"songtitleTV"
    }

    ]
    }]

    Grid Colums:
    [
    {"header": "Title", "width": "60", "sortable": "false", "dataIndex": "title"},
    {"header": "Album Artwork", "width": "50", "sortable": "false", "dataIndex": "artwork","renderer": "this.renderImage"},
    {"header": "Songs", "width": "100", "sortable": "false", "dataIndex": "songs"}
    ]


    The "inputTV":"songtitleTV" refers to a second MigxTV that I setup so I could enter in multiple song titles.

    Form Tabs: [
    {"caption":"Song List","fields": [
    {"field":"songfiles",
    "caption":"Song Files",
    "inputTV":"songfile"
    },{
    "field":"songtitles",
    "caption":"Song Title"
    },{
    "field":"duration",
    "caption":"Duration"
    }
    ]
    }]


    Grid Colums:
    [
    {"header": "Song Files", "width": "160", "sortable": "true", "dataIndex": "songfiles"},
    {"header": "Song Title", "width": "160", "sortable": "true", "dataIndex": "songtitles"},
    {"header": "Duration", "width": "160", "sortable": "true", "dataIndex": "duration"}
    ]

    I feel like I'm close, but I'm missing something. Any help would be greatly appreciated. smiley

    Thanks!
      • 4172
      • 5,888 Posts
      may be a custom-made column-renderer could be your solution.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        You will definitely need a custom output renderer; it would need to take each of the inner "songfile" MIGx TV values and parse the JSON string. Basically a recursive getImageList..
          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
          • 41480
          • 8 Posts
          Thanks so much for getting back to me. I haven't delved that deeply into MIGx, so that's not something I'm familiar with doing. I've been trying to find some documentation, but I'm coming up short. Is there any place that can explain how to do that? I'm guessing I would have to setup the CMP re: these instructions? http://rtfm.modx.com/display/addon/MIGX#MIGX-Step2%3ASetuptheMIGXConfiguratorCustomManagerPage%28CMP%29andPackageManager

          Thanks again!
            • 4172
            • 5,888 Posts
            you want to see the list of songfiles in the grid?
            Then you will need to know some extJs and how to create grid-column-renderers.
            You can define a configuration for your MIGX-TV.
            Then you can add a new grid-config-file under components/migx/configs/grid with the name
            grid.{yourconfigname}.config.inc.php where you would add your custom-renderer-code.

            for examples see grid.config.inc.php

            you will also need to setup the MIGX-Configurator-CMP and create a new configuration for your TV

            to create custom-renderers you will need to know some extJs and learn how to create grid-column-renderers
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              With MIGx, there's two (or three) views; the grid view when editing a resource, a CMP if you're using one, and what gets displayed on the front-end. So it can be a little confusing.
                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
                • 41480
                • 8 Posts
                Ha, it is a little confusing but definitely still a big help. I will try to tackle. Thanks again! smiley
                  • 40045
                  • 534 Posts
                  Hey, I have a similar scenario (MIGX in MIGX, unable to render the inner MIGX in the grid of the outer one > need custom renderer)...

                  did you have any success with the custom renderers, if yes, how did you do it =)?
                    • 4172
                    • 5,888 Posts
                    what kind of column-renderer are you after?
                    what do you want to be the output?
                    The custom-renderer has to decode the json-string and convert it to html, a commaseperated list or whatever you want to see in the column-cell.
                      -------------------------------

                      you can buy me a beer, if you like MIGX

                      http://webcmsolutions.de/migx.html

                      Thanks!
                      • 40045
                      • 534 Posts
                      it definitely is very depending on the use case to be generic, I think, that's the main problem here...

                      in my case there would be an image, text and more stuff, but for now it would be enough if i could show the image from the inner migx in the grid of the outer one.