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

    I've created a MIGX CMP component that collects data (personal info plus answers to some questions) from visitors who wish to register for the event. Here is a screenshot:



    Also I've added filter and can choose attendees on a single event only.
    My question will be about how can I export these selected rows(or all rows) within separate downloaded CSV file?
    Unfortunately MIGX doesn't offer detailed documentation about it, I managed through trials and errors while develop the component and I was lucky to find and add some basic "Export current view" MIGX button(I would like to know more about this button and its historical significance). And yes, it takes only the selected rows, but result is returned as:



    So how can I:
    1. Add another separator here(f.e. semicolon)?
    2. Get the result as a downloadable file(headers will be needed I suppose) not plain text?

    I welcome any information, links to related topics, documentation etc. Please give a hint.

    Many thanks,
    Anton

    [ed. note: himurovi4 last edited this post 11 years, 5 months ago.]
      Anton Tarasov
      MODX Developer

      Email: [email protected]
      Web: antontarasov.com
      • 4172
      • 5,888 Posts
      This should download a CSV - file with the currently filtered items, when you click that button.

      By default it is done within this processor:
      https://github.com/Bruno17/MIGX/blob/master/core/components/migx/processors/mgr/default/export.php

      If you need something customized, you can create your own processor under

      core/components/yourpackage/processors/mgr/default/export.php

      or, if you have defined a processors-path in the MIGXdb - Settings, under

      core/components/yourpackage/processors/mgr/yourprocessorspath/export.php
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 44064
        • 185 Posts
        Bruno17,
        Thanks for the detailed information!

        I've added the own processor for this purpose, I should have guessed earlier that the cause that the file wasn't downloaded could be something with headers... and yes, log said the same:
        PHP warning: Cannot modify header information - headers already sent by (output started at /home/public_html/core/components/migx/configs/grid/grid.editors.inc.php:77)
        Fix for that f.e. can be found here(ot just update MIGX to the latest version):
        https://github.com/Bruno17/MIGX/commit/1a19e1166ebfc24e25b45745784d70a8df087ef6
        Now everything is going right.
        Thank you very much!
          Anton Tarasov
          MODX Developer

          Email: [email protected]
          Web: antontarasov.com
          • 42562
          • 1,145 Posts
          Is it possible to package something like this in an extra?
          I am looking to use MIGX to handle all settings of the extra: I am wondering if this CMP can be exported alongside, easily.
            TinymceWrapper: Complete back/frontend content solution.
            Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
            5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
            • 4172
            • 5,888 Posts
            yes it is

            with migxElementsHelper, you can build a package with all configurations, files (in assets and compontents) snippets, chunks, templates, plugins and manager-menues with some clicks
            All tables, which are defined in the xpdo-schema are created (and updated with new fields) automatically, when installing the package

            All migxXXX - packages like migxMultiLang, migxCalendars, MIGX itself and some others on github was build like that

            As allways, as it is build with MIGX itself, it is extendable to your needs.
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!