In the manager you can add custom plugins that run some PHP code when a MODX event occurs.
In the “Elements” tab (beneath “Snippets”) add a new plugin and change to the tab “System Events” to select the event, when your plugin should run.
The event OnDocFormSave fires after a Resource is saved in the manager via the editing form.
Here you can make changes to the saved resource.
Copy the code from the other thread (linked above) to the field “Plugin code (php):” in the tab “Create/edit plugin”.
Then adapt the code to your needs. Maybe add a check, so that it only runs for resources with a certain template, etc.
Thank you for describing these steps so clearly @halftrainedharry. I have done the following and when a resource is saved / published, I have to change the alias so that it doesn’t match a previous alias. Once it finally saves, the url for that collection is just the root “/’”. What am I missing?
This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.