Replacing a jpg banner with a flash/swf one

tachapeyre - March 11, 2009 - 16:01

Hi,

I would like to replace a jpg banner with a flash / swf one. So far I have only managed to do so by replacing the jpeg with an Animated GIF (CSS / background) though the quality of the image is way below standard.

Can anyone help me out?

Thanks

Tacha

Did you ever accomplish this?

bsenftner - July 6, 2009 - 22:58

Did you ever accomplish this? I'm interested in learning how to do this myself...

-Blake

What what? Should be to

i-sibbot - July 7, 2009 - 15:49

What what? Should be to difficult, how is the jpg banner being implemented..... Is it in the theme tpl files? or inserted via a WYSIWYG editor? Either way, there are many ways to do it and modules such as swftools are quick good, if not a little bloated with functionality for my liking.

Leave more details and I'll get back to you.

I'm working with the Acquia

bsenftner - July 7, 2009 - 19:24

I'm working with the Acquia Slate theme (http://drupal.org/project/themes?text=acquia%20slate). Changing the front-page image is a simple style.css one line change, but trying to change that to be a flash animation is a bit deeper than I've gone so far.

I've got swf tools installed, so getting flash animations into content, and blocks is not that difficult. But replacing that front-page image is requiring more effort.

Is this along the right directions? http://drupal.org/node/181591
I've not modified any template.php files in drupal yet - I've been mostly coming up to speed on other aspects of drupal, and learning javascript & jquery...

To answer your direct questions:

  • The existing jpeg banner is specified as a background image in style.css, like this:
    • background: transparent url('images/cropped/lh_header3.jpg') no-repeat left top;
  • The page-front.tpl.php section that appears to be handling this portion of the page looks like this:

          <div id="preface-wrapper" class="clearfix">
            <?php if ($preface_sidebar): ?>
              <div id="preface-sidebar">
                <?php print $preface_sidebar; ?>
              </div>
            <?php endif; ?>
            <?php if ($mission): ?>
              <div id="mission">
                <?php print $mission; ?>
              </div>
            <?php endif; ?>
          </div><!-- /preface-wrapper -->

    and here's the css for that "preface-wrapper" that handles the front-page image:
    #preface-wrapper {
      background: transparent url('images/cropped/lh_header3.jpg') no-repeat left top;
      height: 355px;
      margin: -33px 0 20px;
      overflow: hidden;
      position: relative;
      width: 960px;
      -moz-border-radius: 0 0 10px 10px;
      -webkit-border-bottom-right-radius: 10px;
      -webkit-border-bottom-left-radius: 10px;
    }

Any help you can offer will be significantly appreciated.
-Blake

Ill have install the theme

i-sibbot - July 7, 2009 - 21:18

Ill have install the theme and have a look.

Right. I havent tried this

i-sibbot - July 7, 2009 - 22:09

Right.

I havent tried this out, but looking at the page-front.tpl it looks fairly spimple. That link you pointed to is a way of doing it. I'll have a play with that tomorrow. The way of implementation in that code is a good example off on how to do things the way Drupal wants you to. I'd give it a crack.

A quick and dirty way would be to insert the object markup required to display your swf straight into the page tpl. You could do this with this tpl file as this themes is using absolute positioning to show the sidebar div. You might have some issue with z-index but that cool to sort (z-index is a stack 0 is below 1 which below 2 etc). Assign a class to the swf and set a lower z-index for and higher index to the preface-sidebar id.

Swf can be fiddly with the z-index stack so you might have to do some reading.

Good luck with your jquery learning.

I really appreciate you're

bsenftner - July 8, 2009 - 00:41

I really appreciate you're looking at this. Just your saying that link is describing the right direction to take is a significant help.

 
 

Drupal is a registered trademark of Dries Buytaert.