Sid04 Posted April 26, 2006 Posted April 26, 2006 I currently have a thin border line around the boxes in the center of my index.php, such as the 'new products' box. How can I remove that border?
Guest Posted April 26, 2006 Posted April 26, 2006 I currently have a thin border line around the boxes in the center of my index.php, such as the 'new products' box. How can I remove that border? number of ways you could simply set the background for the box to the same color as your background, or you can edit the box padding in boxes.php see my contrib for increasing size and instead of increasing size reduce to 0...
Sid04 Posted April 26, 2006 Author Posted April 26, 2006 I have a couple boxes on the index page...and I only need to remove the border from one of those boxes. Is it possible? I cant figure it out in teh code...im trying all kinds of stuff(of course im no PHP genius).
Guest Posted April 26, 2006 Posted April 26, 2006 I have a couple boxes on the index page...and I only need to remove the border from one of those boxes. Is it possible? I cant figure it out in teh code...im trying all kinds of stuff(of course im no PHP genius). which?
Sid04 Posted April 27, 2006 Author Posted April 27, 2006 its a box from a contribution: http://www.oscommerce.com/community/contributions,236
liam1437 Posted April 27, 2006 Posted April 27, 2006 i think i had the same problem but after check ing some codings look for this <?php $info_box_contents = array(); $info_box_contents[] = array('text' => HEADING_SEARCH_CRITERIA); new infoBoxHeading($info_box_contents, true, true); $info_box_contents = array(); $info_box_contents[] = array('text' => tep_draw_input_field('keywords', '', 'style="width: 100%"')); $info_box_contents[] = array('align' => 'right', 'text' => tep_draw_checkbox_field('search_in_description', '1') . ' ' . TEXT_SEARCH_IN_DESCRIPTION); new infoBox($info_box_contents); new infoBoxHeading($info_box_contents, true, true); the both true and true will tell the engine if left image and rightimage is needed... so i think u can chnage to to false to remove it is this wat u looking for?
Guest Posted April 27, 2006 Posted April 27, 2006 its a box from a contribution: http://www.oscommerce.com/community/contributions,236 The box is created as an InfoBox. You can then set the colour of the background for this in the css stylesheet .InfoBox{ background: to the same colour as your main page background. However this will affect all your infoboxes. Similarly as its created as an infobox you can just do the edit of padding in the boxes.php as this will affect all the infoboxes, nor can you use the above for the same reason. :( The only way to do it is to implement something like the custom infoboxes contrib.. You would then need to create your own custom entry, all in all not immensely difficult but not easy either..
Sid04 Posted April 27, 2006 Author Posted April 27, 2006 liam- tried your 'false,false' suggestion. Didnt make a difference in my case. Maybe somebody can help me change the class of this box then? I was playing around...at the end of the file used to generate the box if this line: new contentBox($info_box_contents); I was guessing that the 'contentBox' part was calling the class, right? I searched through my stylesheet file and didnt find 'contentBox' anywhere....so where is it being defined? I did try some other stuff thats listed in the stylesheet file and most gave an error: Fatal error: Cannot instantiate non-existent class: headernavigation Some worked....like one of the header ones and infobox....and interestingly one called 'errorBox' worked and actually took away the border as I wanted! new errorBox($info_box_contents); Now id only like to know WHY it worked...and why the orginal 'contentBox' one works when I cant find it anywhere in the stylesheet.....and if theres any other ways of redefining what class this box is? Thanks for the help thus far guys :thumbsup:
Sid04 Posted April 27, 2006 Author Posted April 27, 2006 liam- upon second look i noticed something. The part that you refer to, the 'infoBoxHeading' section, I totally removed. I think it only has to do with the thick heading on the box....at least thats what was removed after I deleted that section of the code(as I hoped it would).
Guest Posted April 27, 2006 Posted April 27, 2006 liam- upon second look i noticed something. The part that you refer to, the 'infoBoxHeading' section, I totally removed. I think it only has to do with the thick heading on the box....at least thats what was removed after I deleted that section of the code(as I hoped it would). to do what you want to do you are going to need to create a new class in the catalog/includes/classes/boxes.php 1: take a copy of the whole section of code in there relating to infobox from //Default infoBox class to //Default contentBox Class and copy it underneath change anything which starts infoBox such infoBoxContents, infoBoxHeading etc and change them to maincatBox (do not change those bits with info_box!!) edit the sixth line near the top of that new section: $this->table_cellpadding = '1' TO: $this->table_cellpadding = '0' 2: then goto the box provided in the file (under catalog/includes/boxes) and alter the lines which say infoBox to maincatBox 3: Edit stylesheets.css copy the section for .infoBox and paste below it, then replace infoBox with maincatBox
Sid04 Posted April 27, 2006 Author Posted April 27, 2006 Hey, thanks for the help. Im following ya for the most part. My boxes.php you reffered to first must be fairly different then yours, as mine doesnt have the '//Default infoBox class' or '//Default contentBox Class' label. Is this what your file has for the infobox section? class infoBox extends tableBox { function infoBox($contents) { $info_box_contents = array(); $info_box_contents[] = array('text' => $this->infoBoxContents($contents)); $this->table_cellpadding = '1'; $this->table_parameters = 'class="infoBox"'; $this->tableBox($info_box_contents, true); } function infoBoxContents($contents) { $this->table_cellpadding = '3'; $this->table_parameters = 'class="infoBoxContents"'; $info_box_contents = array(); $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1'))); for ($i=0, $n=sizeof($contents); $i<$n; $i++) { $info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''), 'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''), 'params' => 'class="boxText"', 'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : ''))); } $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1'))); return $this->tableBox($info_box_contents); } } Although I may NOT want to copy the 'infoBox' class section because when I use that instead of 'contentBox' none of the content inside the box shows up on my store. No idea what part of the infoBox code causes that. Like I said before, the 'errorBox' class seems to work right and eliminates the border. Do you see anything with the errorBox class that should make me not want to use it? Thanks again for your time.
Guest Posted April 27, 2006 Posted April 27, 2006 Hey, thanks for the help. Im following ya for the most part. My boxes.php you reffered to first must be fairly different then yours, as mine doesnt have the '//Default infoBox class' or '//Default contentBox Class' label. Is this what your file has for the infobox section? class infoBox extends tableBox { function infoBox($contents) { $info_box_contents = array(); $info_box_contents[] = array('text' => $this->infoBoxContents($contents)); $this->table_cellpadding = '1'; $this->table_parameters = 'class="infoBox"'; $this->tableBox($info_box_contents, true); } function infoBoxContents($contents) { $this->table_cellpadding = '3'; $this->table_parameters = 'class="infoBoxContents"'; $info_box_contents = array(); $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1'))); for ($i=0, $n=sizeof($contents); $i<$n; $i++) { $info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''), 'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''), 'params' => 'class="boxText"', 'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : ''))); } $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1'))); return $this->tableBox($info_box_contents); } } Although I may NOT want to copy the 'infoBox' class section because when I use that instead of 'contentBox' none of the content inside the box shows up on my store. No idea what part of the infoBox code causes that. Like I said before, the 'errorBox' class seems to work right and eliminates the border. Do you see anything with the errorBox class that should make me not want to use it? Thanks again for your time. ok well use the contentBox instead it doesnt really matter that should work, yes mine is similar change $this->table_cellpadding = '1';
Sid04 Posted April 28, 2006 Author Posted April 28, 2006 and as for being able to just use the 'errorBox' class?
Guest Posted April 28, 2006 Posted April 28, 2006 and as for being able to just use the 'errorBox' class? its possible you could but I dont know where else that is used Im afraid, so I wouldnt like to say yes and it balls up something else!
Sid04 Posted April 28, 2006 Author Posted April 28, 2006 Does it matter if its used elsewhere? I mean, 'contentBox' and 'infoBox' are used throughout OSC.....why would 'errorBox' being used elsewhere matter? Im surprised that using errorBox doesnt turn the font red or something.
Sid04 Posted April 29, 2006 Author Posted April 29, 2006 OK Simon, here's what I tried: Copied the contentBox section(or at least what I THINK is the complete contentBox section) in boxes.php and changed the names to maincatBox and changed the one cell padding to '0': class maincatBox extends tableBox { function maincatBox($contents) { $info_box_contents = array(); $info_box_contents[] = array('text' => $this->maincatBoxContents($contents)); $this->table_cellpadding = '0'; $this->table_parameters = 'class="infoBox"'; $this->tableBox($info_box_contents, true); } function maincatBoxContents($contents) { $this->table_cellpadding = '4'; $this->table_parameters = 'class="infoBoxContents"'; return $this->tableBox($contents); } } I then changed the name in the contrib file to reflect the new class and it seems to work. Does the above look correct? What does the second cellpadding do? Also, the big question....I didnt change/add to the stylesheet at all. I noticed that there is nothing for 'contentBox' in the stylesheet so I GUESSED that I dont need it for my new class either? Thanks again for your help, i've never made a new class before. Hopefully I did it correctly >_<
Guest Posted April 29, 2006 Posted April 29, 2006 OK Simon, here's what I tried: Copied the contentBox section(or at least what I THINK is the complete contentBox section) in boxes.php and changed the names to maincatBox and changed the one cell padding to '0': class maincatBox extends tableBox { function maincatBox($contents) { $info_box_contents = array(); $info_box_contents[] = array('text' => $this->maincatBoxContents($contents)); $this->table_cellpadding = '0'; $this->table_parameters = 'class="infoBox"'; $this->tableBox($info_box_contents, true); } function maincatBoxContents($contents) { $this->table_cellpadding = '4'; $this->table_parameters = 'class="infoBoxContents"'; return $this->tableBox($contents); } } I then changed the name in the contrib file to reflect the new class and it seems to work. Does the above look correct? What does the second cellpadding do? Also, the big question....I didnt change/add to the stylesheet at all. I noticed that there is nothing for 'contentBox' in the stylesheet so I GUESSED that I dont need it for my new class either? Thanks again for your help, i've never made a new class before. Hopefully I did it correctly >_< The only real reason to do the stylsesheet edit is if you want the box to have its own colours for headings, fonts, etc. You could use the following: .maincatBox { background: #990066; } TD.maincatBoxHeading { font-family: Verdana, Arial, sans-serif; font-size: 10px; font-weight: bold; background: #990066; color: #ffffff; } .maincatBoxContents { background: #f8f8f9; font-family: Verdana, Arial, sans-serif; font-size: 10px; } For this to work you would need to alter you file in includes/boxes added by the contrib where it says contentBox or infoBox to maincatBox
Guest Posted April 29, 2006 Posted April 29, 2006 the second cell padding conrols the padding inside the box where the content is
Sid04 Posted April 29, 2006 Author Posted April 29, 2006 The only real reason to do the stylsesheet edit is if you want the box to have its own colours for headings, fonts, etc. You could use the following:.maincatBox { background: #990066; } TD.maincatBoxHeading { font-family: Verdana, Arial, sans-serif; font-size: 10px; font-weight: bold; background: #990066; color: #ffffff; } .maincatBoxContents { background: #f8f8f9; font-family: Verdana, Arial, sans-serif; font-size: 10px; } For this to work you would need to alter you file in includes/boxes added by the contrib where it says contentBox or infoBox to maincatBox Where is it getting the colors that it uses now? It already uses the default colors of my site, so im not really worried about it. I just wanted to make sure that it is ok to NOT have it in the stylesheet. Im not sure what ya mean with the last part. The contrib didnt add anything in the includes/boxes directory. It added in the includes/modules, and when I said above "I then changed the name in the contrib file to reflect the new class and it seems to work", thats what file I was talking about. I had to change the following line: new contentBox($info_box_contents); to: new maincatBox($info_box_contents); ....just wanna make sure we're on the same page.
Guest Posted April 29, 2006 Posted April 29, 2006 Where is it getting the colors that it uses now? It already uses the default colors of my site, so im not really worried about it. I just wanted to make sure that it is ok to NOT have it in the stylesheet. Im not sure what ya mean with the last part. The contrib didnt add anything in the includes/boxes directory. It added in the includes/modules, and when I said above "I then changed the name in the contrib file to reflect the new class and it seems to work", thats what file I was talking about. I had to change the following line: new contentBox($info_box_contents); to: new maincatBox($info_box_contents); ....just wanna make sure we're on the same page. dont worry about it, it will be using the default colours in stylesheet, which in ur case should be fine ok same thing, but dont worry about it!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.