-
For those who wish to save themselves the trouble of reading this ungodly long post, check out this issue instead: #1478 I'm using AzureBlobStorage for a Piranha project. My user dumped in 4400 images into a Media folder then realized that they didn't want to add an image block 4400 times. They asked me to create a Gallery based upon a folder which I've done. Unfortunately, over a thousand of the images have filenames with "#" - a hash - in them. Every method of encoding that I've tried doesn't affect the hash. I have the images displaying in the site by simply using [image].PublicUrl.Replace("#", "%23"). A little hacky maybe, but it works for now. Unfortunately the images containing the hash still don't work in the Piranha Media Gallery and I can't figure out how to (or if I can) override _MediaGallery.cshtml or maybe I should be looking at piranha.mediapicker.js? Does anyone know if it's possible to override these files? If it is possible, where would my new files go in the file structure? Update 1-13-21: I read through some of the Gitter comments that said "Areas/Manager/Pages" is where I should put the pages that I intend to override. I copied the page (MediaList) into that folder, and made a subtle change and sure enough, Piranha uses my page instead of the one from the library. Awesome, but... There are three partial pages in MediaList that didn't show up (_MediaGallery, _MediaList, _MediaFolderModal). Console gives a Vue warning that says: I'm certain that my inexperience with Vue.js is hindering me at the moment, but I'm not giving up. For those who will question the lengths I'm going to "fix" this, yes, I could have solved the issue of the hash in the filename by editing the filename in Azure (even programmatically) and then updating the filename in the Piranha DB, but I'm using this issue to force me to further my understanding of how Piranha works. Again, any help is welcomed! Later that day: What I did: I added the partial pages (Areas/Manager/Pages/Partial/_MediaGallery and Areas/Manager/Shared/Partial/_MediaPicker & _PreviewModal) without registering them in StartUp and it worked perfectly. I added my hack to replace the hash and the images show up in the Manager's Gallery as expected. What I also did: I also added my own piranha.media.js file, used Gulp to minify it, and that worked as well. I put it in "wwwroot/manager/assets/js". Again, because the file is in the proper folder, I did not have to register it. Of course I removed that file once I had it working in the partial pages. I've run out of time to play around with this, as I have other pressing projects to work on, but I'll be back. Hope my rambling helps someone, and if not, it's still helping me to go through this process. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Submitted as an issue: #1478 Per @tidyui - fixed in 9.0! |
Beta Was this translation helpful? Give feedback.
Submitted as an issue: #1478
Per @tidyui - fixed in 9.0!