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

Answered renderers

  • We see examples of "renderer": "this.renderImage"

    What other renderers are available? Do these correspond to TV output types? For example, "renderer": "this.renderURL"

    This question has been answered by Bruno17. See the first response.

      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
    • discuss.answer
      • 4172
      • 5,888 Posts
      renderers are defined here:

      https://github.com/Bruno17/MIGX/blob/master/core/components/migx/configs/grid/grid.config.inc.php#L216

      you can get a checkbox-group of availiable renderers in the MIGX-Configurator, when adding/editing columns (renderer-tab)

      its also possible to add your own custom-renderers in a custom-grid-config-file

      A special renderer is the renderChunk - renderer.
      You can create a chunk, where you can define the format for that column.
      All fields of the record are availiable as placeholders and you can use snippets and outputfilters in this chunk to get addional datas into the column
      If you need some special-buttons for some record-actions in your column, you can put them also into your chunk.
      You can get the needed html for this buttons by defining for example the renderRowActions-renderer for one of your columns, select the wanted button under the columnbutton-tab and copy the generated html into your chunk.
      Lot of more possibilities with the renderChunk-feature.

      To use this renderer for a grid-column you would choose the renderChunk - renderer and add only one renderOption, fill the name of your chunk into the name-field, nothing else. Thats it.

      You will need the github-Version of MIGX.









      [ed. note: Bruno17 last edited this post 11 years, 4 months ago.]
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
      • Thank you.

        So if I had a resource list TV as a field, I could use a chunk tpl to create a clickable link to the selected resource in the grid?

        I really need to get beyond copying the simple form and grid in the rtfm and modifying to it suit my needs!
          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
          • 4172
          • 5,888 Posts
          Are you talking about a link to the resource in frontend or to the manager-page?

          Both is possible. You can use the joins-feature to get also the fields of the connected resource as placeholders into the column-chunk.

          Loading a window with an iframe of the frontend-resource should also be possible.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
          • In the manager page, in the MIGx grid. It was more of a concept than a necessity, though. Getting the resource ID (from the JSON) in the front-end is easy enough to make a link out of it.
              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
              • 4172
              • 5,888 Posts
              In the manager page, in the MIGx grid.

              yes, in the manager-page, that is what I'm talking about too.

              The question was, if you mean a link from MIGX-grid to the resource on frontend or to the manager-page of this resource.

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

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
              • I had in mind to have the URL to the front-end page, not really a link, so you could see the actual URL in the grid, not just the ID.
                  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
                  • 4172
                  • 5,888 Posts
                  Tested with the latest github-version:

                  Lets say you have a field with name 'resource_id'

                  Do your configurations with the MIGX-Configurator for this TV
                  Add a new column to your grid, lets say with

                  name: resource_url
                  caption: Url
                  renderer: this.renderChunk

                  Create one Renderoption with for example:

                  name: makeResourceUrlTpl
                  all other fields: empty

                  Create a chunk with name: makeResourceUrlTpl
                  Content:

                  [[~[[+resource_id]]]]


                  This did it form me in a MIGX-TV, a column in the MIGX-grid with the rendered URL

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

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                  • Sounds like exactly what I need! Thank you!
                      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
                      • 42046
                      • 436 Posts
                      How do you pass the this.renderChunk template chunk name through the grid columns JSON?

                      I'm also trying to get migx to translate a resource list ID number into the pagetitle/url when displayed TV grid.