Jump to content

extend page clone module


Fantomas
 Share

Recommended Posts

Hi all,

I'm still new to processwire and now I have to create the first hook.

I need to modify the page-clone module, so there is a field in pages that has to be empty after cloning the page. How could I start this task?

Link to comment
Share on other sites

Or, even better since it avoids a roundtrip through the database, would be Pages::cloneReady, which is called after the page is copied in memory and before it is saved to the database. Usage is the same, sans the call to $newpage->save(). I'm using Pages::cloned in my module because I need the ID of the new page which is only available after it has been saved.

  • Like 6
Link to comment
Share on other sites

18 hours ago, BitPoet said:

Or, even better since it avoids a roundtrip through the database, would be Pages::cloneReady, which is called after the page is copied in memory and before it is saved to the database. Usage is the same, sans the call to $newpage->save(). I'm using Pages::cloned in my module because I need the ID of the new page which is only available after it has been saved.

Works perfect. Thanks!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...