How to include images and .swf in custom block template?
Permalink
HI There,
I've read several posts and how to's on custom block templates so sorry if I've missed something basic but I'm having trouble getting assets loading for an HTML custom template.
I'm trying to embed audio using the HTML block and this plugin: http://kolber.github.com/audiojs/...
I've setup a static page for testing (which works) and have now setup a custom template for the HTML block.
Everything loads except that the javascript (which I copied into view.js) isn't finding the two required files which are both in the template folder at the same level as view.php and view.js:
- audiojs.swf
- player-graphics.gif
I've tried:
- Creating a js folder and placing the js file and assets (unmodified) into that folder
- Putting the assets at the root of the c5 install
- Adding /blocks/path/to/audiojs.swf & /blocks/path/to/ player-graphics.gif to the js file
Put each time I load the page, I see "undefined" in the rendered output of:
1. The <object> tag:
2. The CSS (which looks to be injected by the js file):
I'd prefer to get this working without having to modify the audio.js source files - can anyone see what I'm doing wrong?
Any help would be totally awesome!
Cheers
Ben
I've read several posts and how to's on custom block templates so sorry if I've missed something basic but I'm having trouble getting assets loading for an HTML custom template.
I'm trying to embed audio using the HTML block and this plugin: http://kolber.github.com/audiojs/...
I've setup a static page for testing (which works) and have now setup a custom template for the HTML block.
Everything loads except that the javascript (which I copied into view.js) isn't finding the two required files which are both in the template folder at the same level as view.php and view.js:
- audiojs.swf
- player-graphics.gif
I've tried:
- Creating a js folder and placing the js file and assets (unmodified) into that folder
- Putting the assets at the root of the c5 install
- Adding /blocks/path/to/audiojs.swf & /blocks/path/to/ player-graphics.gif to the js file
Put each time I load the page, I see "undefined" in the rendered output of:
1. The <object> tag:
src="undefinedaudiojs.swf?playerInstance=audiojs.instances[%27audiojs0%27]&datetime=1344640136272.2837"
2. The CSS (which looks to be injected by the js file):
.audiojs .play { background: url("undefinedplayer-graphics.gif") no-repeat scroll -2px -1px transparent; }
I'd prefer to get this working without having to modify the audio.js source files - can anyone see what I'm doing wrong?
Any help would be totally awesome!
Cheers
Ben
This may have something to do with trying to load a google translate url
http://translate.google.com/translate_tts?tl=pt&q=%27classico%2...
It seems to work fine in a simple page but I guess it's an unsupported feature of Google Translate so maybe it's being blocked when in c5 somehow?
Cheers
Ben
http://translate.google.com/translate_tts?tl=pt&q=%27classico%2...
It seems to work fine in a simple page but I guess it's an unsupported feature of Google Translate so maybe it's being blocked when in c5 somehow?
Cheers
Ben
As soon as I log out or test in Chrome/Firefox (not logged in) the file (from a remote source) doesn't load.
Is there something about the c5 control panel that would help things load?