I am not sure if I can do this, so I thought I'd ask here.
I want the CMS to be able to add a Page automatically when other pages are added and certain conditions are met.
I have pages that include data for a city and state. I have city and state pages that act as directories for these products. Is there a way that I can add a page, have the CMS check if that city and state already exists, and if it doesn't, then add pages for the city and state? That way, a default one can be made, but a user can go and edit content for that city later if they want.
I'd recommend overriding onAfterWrite function Page that you are adding, then that can call a function like the following to create the page if "certain conditions are met"... and make sure that the page has not already been created is one of those conditions