Previously I blogged about Approvals for moving content in the Episerver page tree. This allowed us as developers to prevent users from moving content pages around in the tree without someone else signing the request off.

The approach works fine, however there is one shortcoming in this approach. That is that the default move confirmation message is still displayed after a user moves a page in the tree:

So this post adds to the previous post and shows how its possible to remove the move confirmation message when using approvals for moving content in the Episerver page tree.

In order to remove the message we need to override the Episerver widget "epi-cms/widget/ContentTreeModelConfirmation". This is done by taking a copy of the ContentTreeModelConfirmation.js file and saving it into your solution. You can find this file by installing the Uncompressed JavaScript for EPiServer 7.6+ and browsing here:

http://<your site>/EPiServer/CMS/<UI version installed>/ClientResources/epi-cms/widget/ContentTreeModelConfirmation.js.

One you have the original save a copy here in your solution:

Next up merge the following into the module.config in the root of your solution to override where Episerver looks for this widget:

Is should be noted that you can place the updated javascript file anywhere within your solution by modifying the module.config change above.

Modify ContentTreeModelConfirmation.js by commeting the following line (note: the rest of the file is removed for brevity):

// START: Customsied confirmation dialog pop up
// Plain move
//confirmation = _showConfirmation(moveTitle, description);
// END: Customsied confirmation dialog pop up

This simple modification prevents the move confirmation messsage from being displayed but continues to show the warning about the change needing approval.

Now when moving a page the confirmation default confirmation message isn't shown:

Thanks

Thanks to Ben McKernan and this forum post for information on how its possible to override the built in Dojo components used in the Episerver UI.

Caution

A quick word of warning. This approach overrides built in Episerver UI components. You should take care during upgrades to ensure that the the epi-cms/widget/ContentTreeModelConfirmation doesn't change. If it does then you will need to re-apply this change and this is the reason the change is clearly commented in the change above.


Comments

Recommendations for you