By JonMB on
Hello all,
I searched the forum and found out how to implement a Flash header into my FriendsForever theme. It's pretty simple, I just edited the page.tpl.php file and put it in the header div.
My problem is that this affects every page in Drupal. I only want the Flash header to show on the home page, like node/1. For the rest of the nodes I want to use a normal JPG image.
Any suggestions would be great!
Comments
=-=
There are multiple ways to go about this however, one way is create a page-front.tpl.php file
now open page.tpl.php and copy the entire contents into your page-front.tpl.php. remove the flash from page.tpl.php and save. Then save and uploade page-front.tpl.php
another method would be inserting some php into the template file. something simiar to
if page=front then do this else do this. Though I can't find that snippet at moment and can't recall teh exact syntax but I know its in the handbook area.
Does Drupal automatically
Does Drupal automatically know that "page-front.tpl.php" is for the front page only?
=-=
yes
Yes, indeed it does. I just
Yes, indeed it does. I just confirmed this myself.
Wow, that was much easier than I expected. Thanks so much! :D
Why go that far? I just
Why go that far?
I just added a block to the top of the page. tell it only to show on the home page and add a flash object.
Just seems like your doing it the hard way o.0
Thanks for your
Thanks for your recommendation. I tried using a block at first but it didn't seem to show correctly. I have modified the FriendsForever template quite a bit, and that's probably why.
Using page-front.tpl.php was the perfect solution in my case.
Only on some pages
I got this to work, but the flash header disappears as soon as I'm too deep into the site. It works on the front page, on the administer page, and on the "about" page. Everything else, it disappears. Any ideas why? Thanks a bunch!
=-=
There are two methods mentioned in this thread. Care to point out which method you used?
Oh, oops. I put the flash
Oh, oops. I put the flash code into the header div tag in page.tpl.php.