zwayne Posted July 28, 2006 Posted July 28, 2006 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?
mtechama Posted July 28, 2006 Posted July 28, 2006 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!
zwayne Posted July 30, 2006 Author Posted July 30, 2006 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.
stevel Posted July 30, 2006 Posted July 30, 2006 header.php is just PHP code. You can test on the page name and do whatever you want. Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description
zwayne Posted July 30, 2006 Author Posted July 30, 2006 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=....)??
Guest Posted August 1, 2006 Posted August 1, 2006 header1.php is for your index page, and header.php is for all the other pages.
stevel Posted August 1, 2006 Posted August 1, 2006 Something like this: <?php if (strstr($PHP_SELF,'index.php')) { ... code for index.php } else { ... code for everything else } ?> Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description
Guest Posted August 1, 2006 Posted August 1, 2006 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.
Guest Posted August 1, 2006 Posted August 1, 2006 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.
Guest Posted August 1, 2006 Posted August 1, 2006 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.
stevel Posted August 1, 2006 Posted August 1, 2006 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. Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description
zwayne Posted August 2, 2006 Author Posted August 2, 2006 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!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.