Mura CMS - Shadowbox issues
I had a few issue this morning getting shadowbox to work within my plug-in view. Maybe below will helps other with similar issues.
- 1) Shadowbox scripts only got added by Mura to header when logged in as an administrator.
- 2) Shadowbox will not load pages that don't have file extensions.
Both of these issues were a simple fix. Let's look at the first problem.
Shadow Box scripts were only loaded when logged in as an administrator. This is because Mura uses these scripts for the edit page function across the top when logged in. However this meant when I was logged in as a user this edit page option is not available thus Mura does not load unnecessary scripts i.e. shadowbox.js
This is good, but in my case I needed the scripts to be included in my layout. Thankfully Mura has made loading all the necessary scripts into the page very easy.
See I told you it was easy! - Honest that's it! Thanks Mura :)
Second issue I then had was with Shadowbox itself, not Mura.
Because I don't use file extensions (IIS rewrite) and if I did then I think index.cfm handles the loading requests anyway at /path/. This means none of my paths actually have filenames or extension, meaning they don't get loaded in to shadow box
Looking at the Shadowbox.js file Mura includes I could see the following lines...
2 img: ['png', 'jpg', 'jpeg', 'gif', 'bmp'],
3 qt: ['dv', 'mov', 'moov', 'movie', 'mp4'],
4 wmp: ['asf', 'wm', 'wmv'],
5 qtwmp: ['avi', 'mpg', 'mpeg'],
6 iframe: ['asp', 'aspx', 'cgi', 'cfm', 'htm', 'html', 'pl', 'php',
7 'php3', 'php4', 'php5', 'phtml', 'rb', 'rhtml', 'shtml',
8 'txt', 'vbs']
9 }
10
11 };
The only way I could quickly solve this problem was to include a blank setting in the iframe list.
2 img: ['png', 'jpg', 'jpeg', 'gif', 'bmp'],
3 qt: ['dv', 'mov', 'moov', 'movie', 'mp4'],
4 wmp: ['asf', 'wm', 'wmv'],
5 qtwmp: ['avi', 'mpg', 'mpeg'],
6 iframe: ['asp', 'aspx', 'cgi', 'cfm', 'htm', 'html', 'pl', 'php',
7 'php3', 'php4', 'php5', 'phtml', 'rb', 'rhtml', 'shtml',
8 'txt', 'vbs', '']
9 }
Now I know this may not be the best way going forward, and it's possible that this issues has already been address in a more recent releases of shadowbox.js. For an immediate solution it works for me.
Mar16



06/01/12 14:30
What are you using the shadow box to display? I have built a page for launching video in jw player with HTML5. I would like to launch my video in the mura shadow box.