Jul 05, 2009, 01:50 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Search via SMF or Google: modx forums all of modxcms.com web
  MODxCMS.com   Forums   Help Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: what is the system event called when a document is moved?  (Read 715 times)
0 Members and 1 Guest are viewing this topic.
Cipa
Sr. Member
****
Posts: 462


« on: Aug 18, 2008, 12:19 PM »

I am looking for a system event that is called when a document is moved.

My plugin, automaticTpl is using OnDocFormPrerender to set the template of a new document.

I would also like to change the template of the document when it is moved. I know it's not a "nice" thing to do but I was wondering if it is possible.

Thank You

Logged

current goal: 666 posts Smiley
plugin: automaticTpl
snippet: ParentParent
manager hack: Custom Manager Tree
plugin [in progress]: templateManager
paulb
Full Member
***
Posts: 134


« Reply #1 on: Aug 18, 2008, 04:23 PM »

This is something I would love to have control over too. I don't think that event exists.

Here's a potentially complicating factor that is closely related: as far as I know, if you're using the right-click menu, this bypasses the system events under some(?) circumstances (see http://modxcms.com/forums/index.php?topic=22759.0). That makes it problematic because you can't count on the same results for actions initiated by the right-click menu vs. the icons over the top of the document. If you can find a way around that, or if you can disprove it, I'd love to hear about it.
Logged
sottwell
Documentation Team
*
Posts: 8,837



WWW
« Reply #2 on: Aug 19, 2008, 07:01 AM »

When a document is moved, the cache is updated, so you could use the OnBeforeCacheUpdate or OnCacheUpdate event. You could then check and make sure the document has the template it should have. If there's no document ID ($_REQUEST['id']) available (this wasn't a document editing/moving cache event), just return to normal processing.
Logged

sottwell.com has moved to a lovely Solaris 10 server!
Log in username guest, password guestuser.
Templates are now becoming available at http://sottwell.com/templates.html
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP

Copyright © 2005-2008 MODxCMS, All rights reserved. Contact Us
Styles by ziworks.com

Powered by SMF | SMF © 2006-2008, Simple Machines LLC

Valid XHTML 1.0! Valid CSS!