Hi there, in this post, I will explain how to override a dialog box in Sitecore. I will take the batch upload as an example.
Sitecore Batch upload :
As you can see below, in the Sitecore media library, there is a cool feature consisting of multi-upload files through the Batch upload.
So far you are not learning new stuff 😀 Ok, let’s continue 😉
What is the need ?
The goal is to add a warning message under the upload button to inform the user with the file size limit upload.
The message is just informative, meaning, that even if the user uploads a file > to size limit (displayed in the warning message), it will be uploaded. There are other ways to block uploading files with a size > limit but this point is not handled in this post.
How Batch upload is handled in Sitecore ?
Before overriding, it is necessary to understand how the OOTB works. It took me just 5 minutes to find what i was looking for 😉
In my local, the File Upload. aspx responsible for batch upload box rendering located as shown below :
How it looks like this file ?
Let’s override upload file :
I used the same code structure from the original Upload. aspx
I just added a <sc: Literal> tag with my message
Below, the new upload file :
Now, how can i use Upload.aspx ?
To make the new aspx file usable by Sitecore, we can choose whatever project in the solution BUT we have to respect the same structure of folders as in the Sitecore solution.
Sitecore > shell > Applications > Media > UploadManager > Upload.aspx
Now, we can see the warning message displayed on red 😉
That’s it ! Enjoy sitecoring 😉