Search the Community
Showing results for tags 'Copying'.
-
I was curious, is it possible to exclude the addHookAfter("saved") from running when copying pages. I have a function (currently running in ready.php) that runs on page save for certain templates. $pages->addHookAfter('saved', function($event) { $page = $event->arguments[0]; if($page->template->name == 'dev' .... The function basically just adds the page title to a csv using fwrite if the name does not exist yet. This is functioning great, however, it also runs when copying the pages which produce some unwanted results, ie: dev-page dev-page-1 (the title of the copied page before I have a chance to rename the title and name). I end up with a bunch of *-# pages, as well as the new page names/titles. Is it possible to somehow get around the copying also running the function?
- 3 replies
-
- copying
- addhookafter
-
(and 2 more)
Tagged with:
-
Hi there, I was wondering if there's a module that allows me to copy certain pages or content from one instance of Processwire to another instance? Unfortunately, I can't copy a whole instance across as there needs to be some major cleanup job performed and it won't get done in time. Otherwise, if anyone has any code samples that would be much appreciated.