Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Header for index page only


clinart

Recommended Posts

Posted

Hello,

 

My site should have a flash embed in the header -- but it should only show on the main page. It's easy enough to get it in the header by editing header.php, but then it shows up on every page.

 

Anyone have any suggestions? Sorry for being such an annoying newb...

Posted
Hello,

 

My site should have a flash embed in the header -- but it should only show on the main page. It's easy enough to get it in the header by editing header.php, but then it shows up on every page.

 

Anyone have any suggestions? Sorry for being such an annoying newb...

 

Would changing the following in index.php

 

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

to

 

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header_main.php'); ?>

<!-- header_eof //-->

 

and then creating a header_main.php file work?

 

Thanks (and sorry) again.

Posted

well of course embedding flash in the header will show up on every page. Almost all front end PHP files have the "<?php require(DIR_WS_INCLUDES . 'header.php'); ?>" statements. If you just want the flash embedded on one particular page, for example.. index.php.. then i would suggest embedding it into index.php only.

 

Search for header and look for the following code.

 

<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="<?php echo FRES_TABLE_WIDTH; ?>" cellspacing="3" cellpadding="3">

 

just add the embedded object after <!-- body //-->.

Posted
Would changing the following in index.php

 

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

to

 

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header_main.php'); ?>

<!-- header_eof //-->

 

and then creating a header_main.php file work?

 

Thanks (and sorry) again.

 

Try ...

 

<?php
 if (empty($_SERVER['QUERY_STRING']))
	  include( DIR_WS_INCLUDES . 'header_main.php' );
 else include( DIR_WS_INCLUDES . 'header.php' );
?>

Posted
Try ...

 

<?php
 if (empty($_SERVER['QUERY_STRING']))
	  include( DIR_WS_INCLUDES . 'header_main.php' );
 else include( DIR_WS_INCLUDES . 'header.php' );
?>

That works. Thanks.

 

Now there's another problem, though: The flash shows like it should, only on the index page, but the rest of the body gets bollixed. At first I thought the .swf file was pushing outside of the header area and somehow messing things up that way, but when I made it tiny, the same thing happened. Could there be some kind of error in the flash file?

 

As long as we're on the subject, how do you make the header taller? I can't find any height parameters in stylesheet.css.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...