Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Overall width ???


Guest

Recommended Posts

Hi, I am trying to the set the overall width to 90%, just not sure what file to alter.

Any help much appreciated :-"

 

 

The overall width is controlled by catalog/application_top.php - this sets the width of the table that incorporates the headings and columns for the whole page.

Link to comment
Share on other sites

Roseybud - I think you might be mistaken. The setting in application_top is for the columns.

 

Karl - To set the overall width, you can install one of the center shop contributions or do it yourself. To do it yourself, add the opening parts of a table in includes/header.php and the closing parts in includes/footer.php. Set the table width to 90% and it will control the whole shop.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

If you are familiar with CSS you can put <div class="myclass"> in the header.php and </div> in the footer.php and use the stylesheet.css to control the width the way you want it.

 

You can also use <table></table> tags instead of CSS.

 

There are also many contributions like the one mention above and "Fixed Width Site with CSS" and "Center Shop" etc...

 

Good luck!

Link to comment
Share on other sites

If you are familiar with CSS you can put <div class="myclass"> in the header.php and </div> in the footer.php and use the stylesheet.css to control the width the way you want it.

 

You can also use <table></table> tags instead of CSS.

 

There are also many contributions like the one mention above and "Fixed Width Site with CSS" and "Center Shop" etc...

 

Good luck!

 

Hey Alpha ray - I like the css method but i actaully can't figure it out. Can you give an example of where you would insert it in the header and footer files and also, can you make the width a fixed pixel size instead of a percentage this way?

Link to comment
Share on other sites

Here is one. All credits to Rhea Anthony (Vger)

 

This Contribution allows you, with a minimum of work, to make your

osCommerce website a fixed width, with a border around the site,

with a background outside of the fixed width site which can be a

contrasting colour, and for the site to be centred on the screen.

 

 

It allows the viewer who has a screen resolution of 800x600 to

view the whole of your site without horizontal scroll bars

appearing.

 

As with all Contributions please backup any files you intend to

edit. The instructions below refer to an unmodified install of

osCommerce.

 

Thanks to Devhype for posting the idea of reducing the modifications

needed in order to make your site fixed in width and centred on

the page. I have taken my original code modification to stylesheet.css,

and added Devhype's idea of just adding the new div class to the

header.php file and the footer.php file.

 

As with the original contribution this works with both

Internet Explorer and with Mozilla based browsers.

 

----------------------------------------------------------------

 

1. A minor modification is required to your stylesheet.css file.

 

Replace the following code:

---------------------------

 

BODY {

background: #ffffff;

color: #000000;

margin: 0px;

}

 

with:

-----

 

BODY {

text-align: center;

background: #ffffff;

color: #000000;

margin: 0px;

}

 

.fixcenter {

width: 758px;

border: solid; border-width: 1px;

background: #ffffff;

color: #000000;

margin: auto;

margin-top: 20px;

text-align: left;

}

 

2. On-page changes:

 

In /catalog/includes/header.php

-------------------------------

immediately below this piece of code

 

if ($messageStack->size('header') > 0) {

echo $messageStack->output('header');

}

?>

 

add

 

<div class="fixcenter">

 

In catalog/includes/footer.php

------------------------------

 

Immediately below the closing php tag

 

?>

 

add this

 

</div>

 

 

That's all you need to do. Within the BODY style, where you see background: #ffffff,

this covers the background of the screen outside of the website. You can change it

to whatever colour you like.

 

Where you see 'text-align: center' this is in place because some versions of Internet

Explorer Browser do not recognise the 'margin: auto' placement style

 

The closing 'text-align: left' is left in place, because even though osCommerce is handled

within tables and this style is declared before the tables start, some versions of Internet

Explorer may try to center the text in the absence of this declaration.

 

This piece of code 'margin-top: 20px' places the start of the web page 20 pixels below the

top of your screen.

 

 

 

I hope this is easy enough to do, even for complete beginners at osCommerce.

 

Rhea Anthony (Vger)

[email protected]

http://www.terranetwork.net

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...