Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

I don't want my page to span the entire screen!


Tara

Recommended Posts

Hey there,

 

I don't like how my site spans the entire width of the screen. I want to make a smaller banner (like 850x150 or something) and then have that centered, and the boxes underneath the banner. You've all seen it before, I'm just not good at explaining. I made a little diagram of what I mean. (go here: www.lovefresh.com/bath2.html )

 

HOW DO I DO THIS?!?!?!

 

 

Thanks my lovelies...

Link to comment
Share on other sites

The HTML for your site starts like this:

 

<!-- header //-->

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr class="header">

<td valign="middle"><a href="http://lovefresh.com//catalog/index.php"><img'>http://lovefresh.com//catalog/index.php"><img src="images/storeheader.jpg" border="0" alt="Love Fresh" title=" Love Fresh " width="1003" height="150"></a></td>

<td align="right" valign="bottom">  </td>

</tr>

</table>

<table border="0" width="100%" cellspacing="0" cellpadding="1">

<tr class="headerNavigation">

<td class="headerNavigation">  <a href="http://lovefresh.com//catalog/index.php" class="headerNavigation">Main</a></td>

<td align="right" class="headerNavigation"><a href="https://lovefresh.com.sslpowered.com//catalog/account.php" class="headerNavigation">My Account</a>  |  <a href="http://lovefresh.com//catalog/shopping_cart.php?" class="headerNavigation">Cart Contents</a>  |  <a href="https://lovefresh.com.sslpowered.com//catalog/checkout_shipping.php" class="headerNavigation">Checkout</a>   </td>

</tr>

</table>

<!-- header_eof //-->

 

<!-- body //-->

<table border="0" width="100%" cellspacing="3" cellpadding="3">

 

The first RED is probably found in /catalog/includes/header.php

 

You would change it to something like this:

 

width="850"

 

The second RED change would be in the PHP code for each page (index.php, contact_us.php, etc.).

 

Make the same change.

 

There may be a few other tweaks along the way...

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

If you want to center your website onscreen in any resolution...I would recommend searching the contribs for something called Dead Easy Center Thingy. Just a few lines of code slapped into the top of one file and you're done.

Link to comment
Share on other sites

I just looked at that contribution.

 

The only problem I have with it is that it creates an unclosed <TABLE> because the only line you add is just another <TABLE> definition.

 

Unclosed <TABLE> elements can cause problems in some situations, and it might work peachy keen 99.99% of the time.

 

Just something to keep in mind if going that route.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Wow, thanks guys, that contrib WAS dead easy. I'm just wondering, I wanted a bit of space at the top, because the banner starts like RIGHT under the address bar. I just want a little vertical space at the top, and actually also at the bottom.

What would I add to this code to make it happen?

 

//begin dead easy outer table

 

print ('<table width="790" border="0" align="center" cellpadding="0" cellspacing="2" bgcolor="#000000">

 

<tr>

<td bgcolor="#FFFFFF">');

 

//end dead easy outer table

 

That was the code from the Dead Easy contrib. Any suggestions?

Here's my site if you want to see what I mean: www.lovefresh.com/catalog

 

THANKS!

Link to comment
Share on other sites

Try this:

 

//begin dead easy outer table

 

print ('<br><br>');

 

print ('<table width="790" border="0" align="center" cellpadding="0" cellspacing="2" bgcolor="#000000">

 

<tr>

<td bgcolor="#FFFFFF">');

 

print ('<br><br>');

 

//end dead easy outer table

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Try this:

 

Hmm, that did make a space at the top, but also a weird space between the border and my banner at the top. & it didn't make a space at the bottom. (www.lovefresh.com/catalog <--to see what I mean)

 

Anything else you'd suggest?

Link to comment
Share on other sites

Change to this:

 

//begin dead easy outer table

print ('<br><br>');

print ('<table width="790" border="0" align="center" cellpadding="0" cellspacing="2" bgcolor="#000000">

<tr>
<td bgcolor="#FFFFFF">');

//end dead easy outer table

 

Then in /catalog/includes/header.php find:

 

<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr class="header">
<td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>'; ?></td>
<td align="right" valign="bottom"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>  <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>  <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?>  </td>
 </tr>
</table>

 

Change to:

 

<br><br><table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr><td><br></td></tr>
 <tr class="header">
<td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>'; ?></td>
<td align="right" valign="bottom"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>  <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>  <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?>  </td>
 </tr>
</table>

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

This:

 

<br><br><table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr><td><br></td></tr>
 <tr class="header">
<td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>'; ?></td>
<td align="right" valign="bottom"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>  <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>  <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?>  </td>
 </tr>
</table>

Should be:

 

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

 <tr><td><br></td></tr>

<td align="right" valign="bottom"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>  <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>  <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?>  </td>
 </tr>
</table>

 

My bad!!!

:blush:

 

And I beleive you still have this:

 

//begin dead easy outer table

 

print ('<br><br>');

 

print ('<table width="790" border="0" align="center" cellpadding="0" cellspacing="2" bgcolor="#000000">

 

<tr>

<td bgcolor="#FFFFFF">');

 

print ('<br><br>');

 

//end dead easy outer table

 

Should be:

 

//begin dead easy outer table

 

print ('<br><br>');

 

print ('<table width="790" border="0" align="center" cellpadding="0" cellspacing="2" bgcolor="#000000">

 

<tr>

<td bgcolor="#FFFFFF">');

 

//end dead easy outer table

 

Remove the last:

 

print ('<br><br>');

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

<tr><td><br></td></tr>

 

Should be

 

<tr><td></td></tr>

 

In your /catalog/includes/header.php

 

or you could just remove it all together he whole line.

Search the forum and contributions before posting. If that doesn't work, keep looking, then post. The forum is for seeking help and advice NOT for someone to do your work for you. Try to do something on your on, if you are going to run a shop then learn how it works.

Link to comment
Share on other sites

Just make sure you test this in other browsers and screen resolutions.

 

This could have all been fixed a lot more painless with CSS but as long as this works for you then go with it.

Search the forum and contributions before posting. If that doesn't work, keep looking, then post. The forum is for seeking help and advice NOT for someone to do your work for you. Try to do something on your on, if you are going to run a shop then learn how it works.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...