We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26085
    • 494 Posts
    fast_content_csv_v03
    Sample of csv file in attachment.

    Module to import data from csv files
    1. Save with code as a new module with name fast_content_csv
    2. Copy file "data.csv" to your /assets/files/ folder
    4. Change t_catalog and t_tovar to your value ( or set them to 1.)
    5. Than just insert parent id and filename and push "Run"
    p.s. You can use debug mode(debug=1) to run module without inserting data into Data Base
    You can use delete param
      • 7455
      • 2,204 Posts
      Nice, in what order does de cvs needs to be? and is it also posible to export to cvs?

        follow me on twitter: @dimmy01
        • 26085
        • 494 Posts
        Quote from: Dimmy at May 31, 2007, 05:14 AM

        Nice, in what order does de cvs needs to be?
        cvs file in attachment
        samething like this.
        parent1;
        ;child 1
        ;child 2
        ;child 3
        parent2;
        ;child 1
        ;child 2
        ;child 3
        parent3;
        ;child 1
        ;child 2
        ;child 3
        

        where parent1and child1 = pagetitle

        and is it also posible to export to cvs?
        Not now. But it is not difficult to realise. May be layter.

          • 26085
          • 494 Posts
          New version is available.
          bug fix
          + add "content" fild

          parent1;
          ;child 1;content1
          ;child 2;content2
          ;child 3;content3
          parent2;
          ;child 1;content1
          ;child 2;content2
          ;child 3;content3
          parent3;
          ;child 1;content1
          ;child 2;content2
          ;child 3;content3
          

          where
          parent - pagetitle of parent page
          child - pagetitle of child page
          content - content of child page
            • 26085
            • 494 Posts
            If samebody had test my module, I an waiting for bug report.
            And wish list
              • 17673
              • 194 Posts
              Hi, very interesting module, congrats!

              I did not have a chance to test it, but I think the natural evolution of this would be to include in the CSV the whole set of controls found in the editing page for a document, i.e. published/cacheable, DocGroups, TVs, keywords..
                ----------------------------------------------------------
                http://www.linkedin.com/in/lucapost/
                http://www.twitter.com/lukwe/
                ----------------------------------------------------------
                • 26085
                • 494 Posts
                Quote from: lukwe at Jun 21, 2007, 04:00 AM

                Hi, very interesting module, congrats!

                I did not have a chance to test it, but I think the natural evolution of this would be to include in the CSV the whole set of controls found in the editing page for a document, i.e. published/cacheable, DocGroups, TVs, keywords..

                New version of module fast_content_csv.zip is avalabel. It supports TV.
                  • 25663 MODX Staff
                  • 12,272 Posts
                  Excellent news SamZ ... this is a very handy module indeed. I hope to test soon. Thanks!
                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • 1535
                    • 84 Posts
                    This is very interesting.

                    The sample file seems very limited and the text is unreadable, is it possible for you to provide a more complete sample file with examples of all the fields supported, preferably in english please?

                    Thanks.

                    Cheers,

                    Andreas
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      I would put each field through $modx->db->escape(), and would also use trim() instead of the ereg_replace:
                        
                      $parent_title = $modx->db->escape(trim($parent_title));
                      $page_title = $modx->db->escape(trim($page_title));
                      

                        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