Buntin1
New Creator

Extend Event Handler When Folder is Created

Jump to solution

I'm looking for a way to extend the event handler that gets called when a folder is created (inside the content tree) so I can run validation.  I also need a way to display a message to the user depending on the validation outcome.  Is there a way to do this?  

0 Kudos
1 Solution

Accepted Solutions
kensnyder
Head of Support

You cannot run code on a folder specifically.  However you can create folder using a model that has a default page i.e. index or default and put code in new.aspx for the template for that page and that code can run upon creation.  For validation you can either place content in the asset or even email the user using Util.Email.

--


Ken Snyder
VP, Customer Support & Cloud Operations

## If I’ve helped, accept this response as a solution so that other’s can find is more quickly in the future.
## Have thoughts on Crownpeak products? We'd love to hear them. Speak with the Crownpeak Product Team..

View solution in original post

2 Replies
kensnyder
Head of Support

You cannot run code on a folder specifically.  However you can create folder using a model that has a default page i.e. index or default and put code in new.aspx for the template for that page and that code can run upon creation.  For validation you can either place content in the asset or even email the user using Util.Email.

--


Ken Snyder
VP, Customer Support & Cloud Operations

## If I’ve helped, accept this response as a solution so that other’s can find is more quickly in the future.
## Have thoughts on Crownpeak products? We'd love to hear them. Speak with the Crownpeak Product Team..

Buntin1
New Creator

Thanks for the reply Kensnyder.  Your work-around is not not ideal for my use case but it's good to know.

0 Kudos