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
-
☆ 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.
-
☆ 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?
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
-
☆ 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.
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
-
☆ 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.