Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Odd stylesheet problem


Guest

Recommended Posts

I have recently been developing a new nav bar for my site. I worked out the code with a little help frm some friends here and tested it and finally put it into my live site. Everything seemed to be going fine when someone in My Store pointed out that when you view it in Mozilla Firebird, it doesn't call the stylesheet and so the whole store is messed up.

 

It is fine in IE but just not in Mozilla Firebird. So I took it out and looked again and without the nav bar, the stylesheet is there but with the nav bar it isn't.

 

So, this is what I added:

 

In header.php I added three lines after the bit which calls the banner so it looks lime this:

 

<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr class="header">
   <td valign="middle" align="center"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'Cheap Sheet Music') . '</a>'; ?></td>
 </tr>
</table>

<!-- additional header bit //-->
<?php require(DIR_WS_INCLUDES . 'extraheader.php'); ?>
<!-- additional header bit_eof //-->

<table border="0" width="100%" cellspacing="0" cellpadding="1">
 <tr class="headerNavigation">
   <td class="headerNavigation">  <?php echo $breadcrumb->trail(' ? '); ?></td>
   <td align="right" class="headerNavigation">

 

If those three lines are there, it doesn't call the stylesheet. But if they aren't, it does!

 

The file it actually calls is extraheader.php and looks like this:

 

<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr class="headerNavigation">
   <td class="headerNavigation"></td>
<td align="right" height="3" class="headerNavigation"></td>
 </tr>
 </table>
<CENTER>
               <TABLE ID="NavigationBar3" BORDER=0 CELLSPACING=0 CELLPADDING=0 NOF=NB_FYHP WIDTH=760>
                   <TR VALIGN=BOTTOM ALIGN=CENTER>
<td><a href="<?php echo tep_href_link(FILENAME_DEFAULT); ?>"><?php echo ((($current_category_id == 0) && (basename($PHP_SELF) == FILENAME_DEFAULT)) ? tep_image(DIR_WS_IMAGES . 'home-on.gif', 'Home') : tep_image(DIR_WS_IMAGES . 'home-off.gif', 'Home')); ?></a></td>

<td><a href="<?php echo tep_href_link(FILENAME_DEFAULT, 'cPath=1'); ?>"> <?php echo ((($current_category_id == 1) && (basename($PHP_SELF) == FILENAME_DEFAULT)) ? tep_image(DIR_WS_IMAGES . 'freemusic-on.gif', 'FREE sheet music') : tep_image(DIR_WS_IMAGES . 'freemusic-off.gif', 'FREE sheet music')); ?></a></td>

<td><a href="<?php echo tep_href_link(FILENAME_DEFAULT, 'cPath=2'); ?>"><?php echo ((($current_category_id == 2) && (basename($PHP_SELF) == FILENAME_DEFAULT)) ? tep_image(DIR_WS_IMAGES . 'sheetmusic-on.gif', 'Sheet music') : tep_image(DIR_WS_IMAGES . 'sheetmusic-off.gif', 'Sheet music')); ?></a></td>

<td><a href="<?php echo tep_href_link(FILENAME_DEFAULT, 'cPath=3'); ?>"><?php echo ((($current_category_id == 3) && (basename($PHP_SELF) == FILENAME_DEFAULT)) ? tep_image(DIR_WS_IMAGES . 'gifts-on.gif', 'Gifts') : tep_image(DIR_WS_IMAGES . 'gifts-off.gif', 'Gifts')); ?></a></td>

<td><a href="<?php echo tep_href_link(FILENAME_DEFAULT, 'cPath=21'); ?>"><?php echo ((($current_category_id == 21) && (basename($PHP_SELF) == FILENAME_DEFAULT)) ? tep_image(DIR_WS_IMAGES . 'cards-on.gif', 'Cards') : tep_image(DIR_WS_IMAGES . 'cards-off.gif', 'Cards')); ?></a></td>

<td><a href="<?php echo tep_href_link(FILENAME_DEFAULT, 'cPath=22'); ?>"><?php echo ((($current_category_id == 22) && (basename($PHP_SELF) == FILENAME_DEFAULT)) ? tep_image(DIR_WS_IMAGES . 'cds-on.gif', 'CDs') : tep_image(DIR_WS_IMAGES . 'cds-off.gif', 'CDs')); ?></a></td>

<td><a href="<?php echo tep_href_link(FILENAME_SPECIALS); ?>"><?php echo (((basename($PHP_SELF) == FILENAME_SPECIALS)) ? tep_image(DIR_WS_IMAGES . 'special-on.gif', 'Special offers') : tep_image(DIR_WS_IMAGES . 'special-off.gif', 'Special offers')); ?></a></td>

<td><a href="<?php echo tep_href_link(FILENAME_ADVANCED_SEARCH); ?>"><?php echo (((basename($PHP_SELF) == FILENAME_ADVANCED_SEARCH)) ? tep_image(DIR_WS_IMAGES . 'search-on.gif', 'Search') : tep_image(DIR_WS_IMAGES . 'search-off.gif', 'search')); ?></a></td>

<td><?php echo '<a href="http://cheapsheetmusic.co.uk/thepit" target="blank">' . tep_image(DIR_WS_IMAGES . 'thepit-off.gif', 'The Pit forum') . '</a>'; ?></td>
                   </TR>
               </TABLE>
</CENTER>

 

Normal site without nav bar:

www.cheapsheetmusic.co.uk

 

Test site WITH nav bar

www.cheapsheetmusic.co.uk/test/default.php

 

Any ideas on why this is happening and what I might do to sort it out?

Link to comment
Share on other sites

Doesn't matter.

 

There was an extra blank line in the stylesheet which IE could deal with but Mozilla and Netscape spat the dummy over!!

 

All sorted now ;)

Link to comment
Share on other sites

Hi Julie, good to see you sorted out your problem. I am relatively new to the whole OS commerce thing..

 

I checked out your site, and it looks great. I wonder if you could offer a little bit of advice on how to do the following...

 

1. i want to add a large banner at the top of my page also.. where do i edit the code for that.

 

2. i also want to include small icons alongside each 'Category' in the 'categories section' .. do you know where i might add this code?

 

3. and finally, i like you extra menu about the 'Welcome to CSM' greeting on your home page. Where do you insert the code to add that..?

 

I am sorry if i have lots of questions julie, but any help you could offer would be greatly appreciated.

 

I have a good knowledge of HTML, but when it comes to php i am a little lost. I just need to know where to place my HTML code.

 

check out my site.. www.distraektrecords.com and my store also is www.distraektrecords.com/shop

 

Many thanks Julie..

 

Gary Wilson

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...