By marcin-mark on
it is 5am and I am desperate to figure this out...
I am trying to embed a .swf banner into the top content of my salamanderskins theme. I am pasting the following code into the ppage.tpl.php
<?php endif; ?>
<div id="middlecontainer">
<table border="0" cellpadding="0" cellspacing="0" id="content">
<tr>
<?php if ($sidebar_left) { ?><td id="sidebar-left">
<?php print $sidebar_left ?>
</td><?php } ?>
<td valign="top">
<?php if ($mission) { ?><div id="mission"><?php print $mission ?></div><?php } ?>
<div id="main">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="750" height="175">
<param name="movie" value="sites/all/themes/salamanderskins/images/atm.swf" />
<param name="quality" value="high" />
<embed src="sites/all/themes/salamanderskins/images/atm.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="748" height="175"></embed>
</object>
<?php if ($section1count > 0): ?>
<?php if ($breadcrumb): ?><div id="breadcrumb2"><?php print $breadcrumb; ?></div><?php endif; ?>
<?php endif; ?>
<?php if ($content_top):?><div id="content-top"><?php print $content_top; ?></div><?php endif; ?>
<h1 class="title"><?php print $title ?></h1>
<div class="tabs"><?php print $tabs ?></div>
<?php print $help ?>
<?php if ($show_messages) { print $messages; } ?>
<?php print $content; ?>
<?php print $feed_icons; ?>
<?php if ($content_bottom): ?><div id="content-bottom"><?php print $content_bottom; ?></div><?php endif; ?>
</div>
</td>
<?php if ($sidebar_right) { ?><td id="sidebar-right">
<?php print $sidebar_right ?>
</td><?php } ?>
</tr>
</table>
</div>
<?php
all i get is a white box...
please help anyone
Comments
Change: <object
Change:
To:
James T
Action Medical Research - www.action.org.uk
Just
http://drupal.org/search/apachesolr_search/embed%20flash
THANK YOU
i added the back slash /sites/all/themes/salamanderskins/images/atm.swf ... still same problem...
my site is www.atmautos.com
as you can see, evil white box of death
try goto drupalway.com, login
try goto drupalway.com, login as user demo (psw=demo)
see if that's what u want ..
if yes, I may send u the code ...
I would be more...
concerned about http://www.atmautos.com/content/07-honda-accord-ex
yeah, I have filefield, and I
yeah, I have filefield, and I enter multiple images and it doesn't group them... its frustrating, any suggestions?
looks good, I really like the
looks good, I really like the bimmers...
my .swf file is a movie that loops... i wish i could get it to work... but yes, essentially it should be placed in the same fashion...
1. of course, u should
1. of course, u should already have your myswf.swf ready in the theme folder
2. u also need swfobject.js. do a google earch. download it and put it in the theme folder.
3. assume your theme is named "xxxx"
4. modify your tpl.php as follows ..
** xxxx is your theme name
--------------------------------------
we go the drupalway, how about u?
drupalway.com
THANK YOU
Still not working for some reason... am I doing something wrong?
1. u have forgotten to add <
1. u have forgotten to add < ? p h p and ? > for my codes
2. those '.....' is not need
3. "print $x" should be added in the right position..where u want to show the swf.
Now I get this: Parse error:
Now I get this:
Parse error: syntax error, unexpected T_VARIABLE in /home3/atmautos/public_html/sites/all/themes/salamanderskins/page.tpl.php on line 150
Is this right? // include
Is this right?
no .."$x = .." is a long
no .."$x = .." is a long line. try this ..
THANK YOU! Hooray, it
THANK YOU!
Hooray, it works!
Hi guys, I did the same but i
Hi guys,
I did the same but i get this error
// include swfobject.js // set up the swf divHow to fix this ?
about the "// error" .. there
about the "// error" ..
there are just comments...remove it in case of any error ..
This my code, is anything
This my code, is anything wrong in this?
wo..u need 2 print $x, 1st
about the "// error" ..
there are just comments...remove it in case of any error ..
wo..u need two print $x,
1st print out the "include swfobject.js"
2nd print out the < d i v id="my_banner"> for your logo
u have to find a right position to print the < d i v id="my_banner"> according to your need.
BTW, it is marcin's post. in case u still have question, pls open a new post.
Thank you!
Thank you!
This is how I use flash
This is how I use flash banners in my templates.
1) install swftools module
2) install swfobject2 module (part of swftools - requires that swfobject.js be downloaded and placed in 'shared/swfobject2' inside the swftools module folder )
3) go to swftools settings, and set rendering to be done by swfobject2
4) create a file called template.php in the theme folder
5) use this code inside template.php
6) In page.tpl.php, you can then output the flash file using the variable $flash_banner:
<div id="flash_banner"><?php print $flash_banner; ?></div>Why this method is good:
1) It uses swfobject which is cross browser compatible, and produces valid markup
2) It keeps a separation between function (template.php) and design (page.tpl.php)
3) It follows drupal coding standards
4) It's clean, easy to read code
5) It doesn't take a lot of code to do it, making the code easier to read
6) It provides a replacement image for people who can't view flash for whatever reason
7) It provides replacement text for people who who also have images turned off (i.e. blind people using screen readers, or some people using cell phones)
Contact me to contract me for D7 -> D10/11 migrations.
This worked for me! I have
This worked for me!
I have installed SWFtools module
It's come to my attention
It's come to my attention that in my example code above, I used the name of my theme, meaning that the code won't work for others who are trying to use it. You need to change:
function qqeigo_preprocess(&$vars, $hook)to:
function phptemplate_preprocess(&$vars, $hook)or else:
function THEMENAME_preprocess(&$vars, $hook)where you replace 'THEMENAME' with the name of your theme.
Contact me to contract me for D7 -> D10/11 migrations.