Hi, I am new at this sort of thing, however I would like to be able to know how to be able to replace the entire header in the FriendsElectric theme with a flash file. I can easily change the logo no problem, its a static image file, which I can replace, however I cannot seem to figure out how to add flash so that the entire header is in flash. I am not really that great at working with PHP or where to even look to edit this, however if anyone can help me with this that would be great.

Comments

Cal34’s picture

I have been trying to do the same thing with my site and no luck.
This awesome Drupal site has been able to do it using the Kubrick theme:

http://www.partcafe.hu/vizisipalya/

They even got their fancy menu going as well!

if you look at the source code they have the flash code between

"div id=header" tags which is found at the top of the source code.

I am going give it shot and if I am successful. I will gladly show you how to do this. I know how frustrating it is good luck!

zirafa’s picture

I've done this at some point or another - what I would recommend doing is "hard coding" the flash header into the document. go to the themes folder where the theme is held and poke around there. look for layout or node.tp.php or a file named as such. poke around for some code that looks like it is loading the top header image, delete it, and embed the flash you want with html directly. let me know if you have trouble.

Cal34’s picture

I have edited the kubrick theme layout page.tpl.php header tag and replaced the Flash object but no luck. More help is appreciated. I am sure "snowball" and I are not the only Drupal newbies grappling with this problem. Thanks!

Cal34’s picture

Edited the page.tpl.php located in: themes>FriendsElectric

BUT I had to delete some php.endif tags to make it work and for some reason the side boarders disappear and gets all weird.

Snowball I can't seem to post the code so if you want the code email me. Thanks to zirafa!

thatmtnman’s picture

I am also trying to drop a Flash header into the code..and just blew up my site...if you or anyone can tell me how to do this that would be great!

cheers

Frank

Cal34’s picture

Sure. Which theme are you using?

kevlaa’s picture

Has anyone got the code for this as I to am trying to get this to work I have been trying to get it to work with the theme obsidian and kubrick

many thanks

Kevin

reflectant’s picture

If i wanted to imbed flash for navigation...what theme should i be using?

garm’s picture

you know guys, just drop your embed flash code in the header (div) (to have a flash based header or top navigation system in flash), that´s all there is to it, it has nothing to do with themes (even tho some themes of course is better suited for it, leaf and kubrick are pretty nice for that type of style)

and dont forget to wipe out the old php code for the header and to deal with the few visitors whom wont have flash.

OK Computer’s picture

Hey... just upgraded to 4.6.* and it's been a VERY long time since I messed with Drupal.

I'm interested in placing a flash header as top navigation for my site. You mention header (div), could you explain what this is please?

Or if anyone else has sorted the problem, please inform me how you do it!

Thanks
Ritch

vonsko’s picture

it looks to work to me without any problem, deal is you must remember that flash tag (embed) need more relative paths sooo:
iam workin on gespaa and flash name is a_nm.swf

so it looks just like this and working: src="themes/gespaa/a_nm/swf"

Sinnersoul’s picture

This is my first time posting here and glad to help with some coding. Thx to Cal34's suggested site I was able to use a swf as a web site logo. Here is how I did it:

(Was a really pain in the ass to post code here, so, here is as a link)

Click me

That's all. Thx Snowball for starting this thread.

AmirTheSeventh’s picture

1. Open page.tpl.php and look for <div id="header"> add:

<div id="header" width="XXX" height="XXX">

where XXX is the size of your flash movie.

2. The following code after that one:

<div class="hw1"><div class="hw2">
  <?php if ($logo): ?>
    <a href="<?php print url(); ?>" title="Index Page"><img src="<?php print $logo; ?>" alt="Logo" id="site-logo" /></a>
  <?php endif; ?>
  <?php if ($site_name): ?>
    <h1 id="site-name" class="<?php print $site_slogan ? 'with-slogan' : 'without-slogan'; ?>"><a href="<?php print url(); ?>" title="Index Page"><?php print $site_name; ?></a></h1>
  <?php endif;?>
  <?php if ($site_slogan): ?>
    <span id="site-slogan"><?php print $site_slogan; ?></span>
  <?php endif;?>

Must be erased with their corresponding </div> codes on line 49. Keep in mind to just erase two </div> codes, 'cause the third one close the <div id="header"> code which handles all the header code.

3. Replace the code on step 2 after <div id="header" width="XXX" height="XXX"> with this one:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="XXX" height="XXX"> <param name="movie" value="yourlogo.swf" /> <param name="quality" value="high" /> <param name="wmode" value="Transparent" /> <param name="menu" value="false" /> <param name="scale" value="noscale" /> <embed src="yourlogo.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="XXX" height="XXX" wmode="Transparent" menu="false" scale="noscale"></embed> </object>

Where yourlogo.swf is the name of your swf logo. Change those XXX with the swf's width and weight. Keep in mind that the swf file must be  STORED at the root folder where Drupal is running, usually the root folder of your site not in your template's folder. 

4. If you don't want to keep the search bar which appears right bellow the logo, you'll need to erase also this code:

  <?php if ($search_box): ?>
  <form action="<?php print $search_url; ?>" method="post">
    <div id="search">
      <input class="form-text" type="text" size="15" value="" name="keys" /><input class="form-submit" type="submit" value="<?php print ucfirst($search_button_text); ?>" />
    </div>
  </form>
  <?php endif; ?>

5. If you don't want to keep the menus which appears over the logo, you'll need to erase also this code:

  <div id="top-nav">
    <?php if (is_array($primary_links)): ?>
      <ul id="primary">
      <?php foreach ($primary_links as $link): ?>
        <li><?php print phptemplate_wrap_links($link, 2); ?></li>
      <?php endforeach; ?>
      </ul>
    <?php endif; ?>

    <?php if (is_array($secondary_links)): ?>
      <ul id="secondary">
      <?php foreach (array_reverse($secondary_links) as $link): ?>
        <li><?php print phptemplate_wrap_links($link, 2); ?></li>
      <?php endforeach; ?>
      </ul>
    <?php endif; ?>
  </div>



raanan’s picture

This technique seems to work at first, it is the same one I came up with using the kubrick theme. However, the flash header only shows up on the root directory and single level subdirectories. If a subdirectory is two levels deep i.e. http://www.domain.com/subdirectory1/subdirectory2/ the header won't appear.

Example:
it will appear on domain.com/user/register
but not on domain.com/user/register

My quick solution was referencing the entire url for the swf
<param name="movie" value="http://www.domain.com/yourlogo.swf" />
and likewise where applicable. This is a cheap way to do it, and I'm currently trying to figure out how to reference the current theme directory through php so it can be used on multiple sites (having everything contained within the theme's directory)

kevincompton’s picture

I am trying to do this to the ABAC theme and NOTING is changing! I delete stuff and it's just not affecting it! What step am I missing?

rolandk’s picture

Can someone show me how to slot in a flash header/menu in Alek 2.0 theme ?

monstordh’s picture

Here's an optional way to include Flash in your page.tpl.php file:

http://drupal.org/node/190583#comment-720978

gigfish’s picture

hi all,

i have a swf file for upload and want to put it where the header image is. Im using Four seasons if u know it its the color area below top horizontal menu that i want to place the flash.. im not a code guy btw

also the creator of my swf has asked what the dimensions of this space are ( how can i find this?, or can soemone just tell me....

much appreciated

is anyone kind enough to help

Thanks

cazam’s picture

Hi there,

You can actually take a screen grab of the page and open a program like photoshop and use the ruler to measure - it is accurate!

Better way is o look in the css and find the sizes of the divs. You can find what the div is called by selecting the area on the webpage you want to know about, right clicking and selecting 'view selection source' (as opposed to page source which gives you the whole thing).

Makes it easier to find the needle in the haystack css if you know what it is called!

Good luck.

Carrie
CAZAM Ltd
http://www.cazam.eu

cazam’s picture

Got all this working by following your instruction. Bit of playing around with exactly where to put the flash to get the alignment working nicely in different browsers. Settled on replacing within the "title" div in the end ie:

<div id="title">
		<h1><a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><?php print($site_name) ?></a></h1>
		<h2><?php print $site_slogan?></h2>
			</div>

replaced with:

	<div id="title">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="XXX" height="XXX"> <param name="movie" value="yourlogo.swf" /> <param name="quality" value="high" /> <param name="wmode" value="Transparent" /> <param name="menu" value="false" /> <param name="scale" value="noscale" /> <embed src="yourlogo.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="XXX" height="XXX" wmode="Transparent" menu="false" scale="noscale"></embed> </object>
</div> 

And it works awesome - thanks for the code and explanation!!!