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

    I have some old documents that I need to move to modx. The articles where created last year and I need to set up the createdon date in the past.

    Is there an easy way to do this?

    If not I’m thinking of creating a date TV and use a manager event to alter the createdon date.

    Thanks
      • 18389
      • 169 Posts
      I too would like to find out how to do this.
      I read a couple of workarounds like plugins and modules but they did NOT work.


      For example this site:
      http://modxrules.com/articles/alter-the-createdon

      It says that one way to do it is to "use the DocManager module" with no further explanation. I don’t get how you would do that.

      The second way was to create a TV and a plugin, but it didn’t work for me.

      Is there anyway to get another field for "createon" in QM like the published and unpublished dates?
      Is this a dead and forgotten issue?

      The ability to "falsify" the created date is necessary if you ever have to move a site or rebuild one.

      This should be included in as part of the core!

      Does anyone have any ideas for this?
        www.markojokic.com
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        In the DocManager module, in the "other settings" tab, you can specify a date for the "Created On Date" field (clicking on the field opens a mini-calendar date picker), then at the bottom indicate what documents to reset to that date.
          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
          • 5340
          • 1,624 Posts
          Quote from: markoj at Jun 16, 2010, 10:51 AM

          The second way was to create a TV and a plugin, but it didn’t work for me.

          Any ideas why it did not work?
          I would like to update the article to something that works for you too.
            • 18373 ☆ A M B ☆
            • 3,141 Posts
            Quote from: cipa at Jun 16, 2010, 12:05 PM

            Quote from: markoj at Jun 16, 2010, 10:51 AM

            The second way was to create a TV and a plugin, but it didn’t work for me.

            Any ideas why it did not work?
            I would like to update the article to something that works for you too.

            If you’re going to update, could you consider adding in how to use the doc manager for those who end up on that site and still are puzzled?
              Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

              Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
              • 18389
              • 169 Posts
              Thanks for the reply sottwell. As usual you come to the rescue to clarify or explain!
              I am going to go with the docmanager option for now.

              Cipa- It’s not that I didn’t like the idea of using a TV to change the date. It didnt work though.
              I followed the instructions exactly. When I changed the date in the TV, it simply did not change the actual date at all.
              I am not sure why.

              I would like to see what more gets written about all of this.
              Thanks again!
                www.markojokic.com
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                A TV won’t change the actual createdon date; I think the suggestion meant that you use a date TV instead of the createdon date.
                  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
                  • 18389
                  • 169 Posts
                  That would make sense if it was only a TV...

                  why would I need the plugin then?

                  I thought that maybe the plugin and TV combo was supposed to have the same effect as using the docmanager but easier for a user to change, through QM.
                    www.markojokic.com
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    I hadn’t really looked at it, but now I see that you create the TV to specify the date you want to use, and the plugin is configured to use the onDocFormSave event to get the TV value, convert it to a UNIX timestamp, and update the createdon field. This would do the job, but for modifying a number of resources at once the DocManager module would be a much better solution since with the TV/plugin method you have to open and set each one’s TV value and save it, one at a time, while with DocManager you can update them all at once.

                    Now, if you wanted to update the times to be more realistic per your new site, but still wanted to be able to sort them by createdon, a batch modification to one timestamp wouldn’t be of much use. However, since each resource is saved in consecutive order and automatically given an ID when inserted into the database, you could just use the ID as the sortBy field.

                    It all depends on exactly why you want to modify the date and what you’re going to do with 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