By negatifo on
I'm using drupal 7 and marinelli theme, I'm trying to put an .swf file for my site logo is this possible for ver.7 or not? Thanks!
I'm using drupal 7 and marinelli theme, I'm trying to put an .swf file for my site logo is this possible for ver.7 or not? Thanks!
Comments
place links to swfobject.js in head section in html.tpl.php
This is untested with Marinelli but I have used a similar approach with another theme.
Start by downloading swfobject and create an "ext" folder in marinelli theme to drop in swfobject files.
http://code.google.com/p/swfobject/wiki/documentation
Then go to edit marinelli/templates/html.tpl.php to create link to marinelli/ext/swfobject/swfobject.js.
Put the script links below just before the line containing </head> in html.tpl.php.
You should then be able to use swfobject.js to write your logo.swf file into div name "logo-container" in page.tpl.php.
The body of code in html.tpl.php should look like this (I've referred to "test.swf" in the swfobject distribution as the test logo but you can add your own logo.swf with different arguments).
You might have to tweak the logo-container div css to allow logo.swf to be written in there.
tested code ..
This code seems to work in Marinelli
It could be embedded as html (instead of php as above) .. but you might wish to tweak it to use php include to switch different blocks of swfobject code into <head> .. </head> section for different logos.
and using relative paths instead of absolute paths ...
typo error corrected below in next post ..
and using relative paths instead of absolute paths ...
alternative text content if flash player is not installed ..
One further refinement.
If the client browser does not have the required version of flash player installed swfobject provides for alternative content to be displayed with "get Adobe Flash Player" logo with a link to http://www.adobe.com/go/getflashplayer.
This requires some code to be included in the target container .. in this case "logo-container" in page.tpl.php.
So you can
either
(a) insert no alternative text code and instead create a custom logo.png (120px x 120px) which displays when the flash player is not installed.
or
(b) insert the alternative text code and comment out the php code which writes logo.png into the container.
This is how the div logo-container has to be edited ..
You can test this by setting the swfobject argument defining flash version to be higher than your installed flash player version .. e.g. "12" .. and on refresh the alternative text or alternative logo.png will be displayed.
Big Thanks
Thanks Man I got it working. (beer) :)
need help!
I have a problem. I don't have html.tpl.php in my theme ( Corolla). Where should I put this code? Can I put it in page.tpl.php instead?
Thanks