Problems, need help? Have a tip or advice? Post it here.
6 posts Page 1 of 1
Trying to preserve the modification dates of pages while making updates via cronjobs so clients original last edit stays accurate to their history.

Code: Select all
<cms:db_persist
_masterpage='user-data.php'
_mode='edit'
_page_id=k_page_id
k_page_modification_date=new_date
>


new_date is giving a date format of: Y-m-d H:i:s

What is the proper line for k_page_modification_date within db_persist? thank you.
The modification date is always internally set to the time the page was saved - that is to say, it cannot be set from code.
The only idea I can think of now is to make another template for these fields and update that with the API data from the cron script and save the user id along with it so then I can use another cms:pages tag within the main user cms:pages tag to display the information.

If this was an option through db_persist for developers it would be nice because if the developer needs to update data in the cloned page that is not relative to the client, but relative for the front-end page to function, it would be ideal to preserve the last modification date the client had known for that page. Not have a date display that is updating every 10-minutes via cron as cloned page data is being updated via code.

Maybe another option like _auto_title='1' but _modification_date='1' would preserve the date and 0 would update it currently does. Or when _modification_date='1' it would enable us to add k_page_modification_date= to the db_persist as you do with k_page_title and auto_title.

I hope this is considered, thanks. :)
the last modification date the client had known for that page

Easy. If the client only edits the page in backend then add a hidden datetime editable. Update it with cms:persist in template config. As you probably remember, cms:persist only fires from within admin panel form view. Your cron job save should not update the hidden field.
ty trendo, that trick worked nicely.
Blutbaden wrote: ty trendo, that trick worked nicely.

Tricks are my specialty! :idea: I am leaving this forum, but you may address me directly in PM.
6 posts Page 1 of 1