Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Unique Banner for Home Page?


zwayne

Recommended Posts

Posted

I want a unique graphic banner displayed underneath the home page logo (though the question is applicable to any specific page.) Header.php (which references the logo) gets inserted into all pages so I can't put it in there. There is a section unique to the home page in index.php (e.g., the "else" section where text_main is inserted) but that's goes into the body of the home page.

 

Any ideas?

Posted
I want a unique graphic banner displayed underneath the home page logo (though the question is applicable to any specific page.) Header.php (which references the logo) gets inserted into all pages so I can't put it in there. There is a section unique to the home page in index.php (e.g., the "else" section where text_main is inserted) but that's goes into the body of the home page.

 

Any ideas?

 

 

Are you looking to replace the osC logo or What?

Wade Morris

Amarillo, Texas

 

Before you do any changes on your site you need to do BACKUP! BACKUP!

Posted
Are you looking to replace the osC logo or What?

 

No. I have a specific logo on all pages. However, I want the home page to be unique.

Posted
header.php is just PHP code. You can test on the page name and do whatever you want.

 

Yes, I understand this but it's not as simple as you are implying. Again, the question is how do I put a unique banner on just the home page? One cannot just modify header.php as the code gets inserted into every page. Nor can I easily modify index.php as it is used for all of the catalog subpages. And the section in index.php section that reads text_main (the text for the home page) modifies the body text only.

 

Let me put it another way: how can I modify header.php so that it is detecting whether the home page is being loaded (e.g., site.com/index.php and NOT site.com/index.php?cPath=....)??

Posted

header1.php is for your index page, and header.php is for all the other pages.

Posted

Duplicate your header.php file and call it header1.php and in catalog/index.php change the call for includes header.php to header1.php.

 

Modify your header1.php anyway you like as its only called for the index page.

 

Unfortunately though, the index page is also used as the main page plus its used for displaying categories etc.

Posted

ANother way, would be like the <php echo "text_main"> blurb, create another call e.g text_main1 and then in catalog/includes/english/index.php create another text_main and rename it to text_main1 and insert your banner code there.

Posted

If you study the index.php you will see its split into roughly 3 sections, one for categories, one for the main content and the third is to do with subcats etc.

Posted
Ah, yes, I had forgotten abouty that. You could also check to see if $_GET['cPath'] is null and do the special code only if both tests are true.

 

Excellent! This does the trick in header.php:

 

<?php if ((strstr($PHP_SELF,'index.php')) && ($_GET['cPath']==''))  {
?>
 <tr><td width="100%" align="center" valign="middle"><?php echo tep_image(DIR_WS_IMAGES . 'homepagebanner.jpg' ); ?></td></tr>
 <tr><td> </td></tr>
<?php
 }
?>

 

Thanks!

Archived

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

×
×
  • Create New...