trophy Posted January 30, 2010 Share Posted January 30, 2010 Looking for advice on how to setup a fixed height for the Infobox as I need to put more information into it. Appreciate any help, have looked for ages and can not find a thread. Link to comment Share on other sites More sharing options...
germ Posted January 31, 2010 Share Posted January 31, 2010 Looking for advice on how to setup a fixed height for the Infobox as I need to put more information into it. Appreciate any help, have looked for ages and can not find a thread. Based on this thread The code would go something like this: <?php /* $Id: information.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ ?> <!-- information //--> <!-- beginning of my added code adjust these two lines to suit your requirements: width: 125px; height: 150px; //--> <style type="text/css"> ul { margin-top: 0px; margin-bottom: 0px; margin-left: 0px; padding-left: 0px; } .scrollArea { width: 125px; height: 150px; padding-left: 5px; padding-right: 5px; border-color: #6699CC; border-width: 1px; border-style: solid; float: left; overflow: auto; } </style> <!-- end of my added code //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_INFORMATION); new infoBoxHeading($info_box_contents, false, false); /* in the code below i added: <span class="scrollArea"> and: </span> */ $info_box_contents = array(); $info_box_contents[] = array('text' => '<span class="scrollArea"><a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' . '<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' . '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' . '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a></span>'); new infoBox($info_box_contents); ?> </td> </tr> <!-- information_eof //--> 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 More sharing options...
trophy Posted January 31, 2010 Author Share Posted January 31, 2010 Thanks for the quick reply. Which / where do i put that code? Link to comment Share on other sites More sharing options...
germ Posted January 31, 2010 Share Posted January 31, 2010 Thanks for the quick reply. Which / where do i put that code? What I posted was the default /catalog/includes/boxes/information.php with my additions clearly noted. You should use YOUR FILE and just make the minor alterations. BACKUP THE FILE BEFORE YOU BEGIN. You may not like it after you get it working, but it does work. I've already tested it in a development area of an existing site. 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 More sharing options...
trophy Posted February 13, 2010 Author Share Posted February 13, 2010 Germ Thank you for the coding works a treat. I have deleted the border to match my layout and adjusted the height. I now would like to move the word/heading within the box further down the box and it's links. This is my site http://hobbiesplus.co.nz/ Where would I do that? Link to comment Share on other sites More sharing options...
trophy Posted February 13, 2010 Author Share Posted February 13, 2010 I was not quite clear in the above. I now would like to move the word/heading "LINKS" further down the box and it's links below it. Link to comment Share on other sites More sharing options...
germ Posted February 13, 2010 Share Posted February 13, 2010 I was not quite clear in the above. I now would like to move the word/heading "LINKS" further down the box and it's links below it. The easiest way to add some space would be to add a few <br> just before the <a href= in the code that makes the LINKS link. 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 More sharing options...
trophy Posted February 13, 2010 Author Share Posted February 13, 2010 Thank you again, I have got it to work. I really appreciate the help you have given me over the years. Your efforts and others who have helped people like me have made getting my website to where I want it much easier, otherwise it would not have happened. Link to comment Share on other sites More sharing options...
germ Posted February 13, 2010 Share Posted February 13, 2010 Thank you again, I have got it to work. I really appreciate the help you have given me over the years. You're welcome. :) When you get enough links in there the box will stay the same height but a scroll bar will show up on the right side. I tested it with the Webdeveloper plugin in Firefox to be certain it was going to work for you. 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 More sharing options...
trophy Posted February 13, 2010 Author Share Posted February 13, 2010 Yes as you say the scroll does work and the scroll bar will appear when the box is made smaller than the contents, I checked that out. Link to comment Share on other sites More sharing options...
resga Posted February 24, 2012 Share Posted February 24, 2012 Thank you for posting the solution to this challenge. I would also like to setup a fixed height for the Infobox. I have applied the suggested changes to /includes/boxes/information.php, but if I refresh the page after uploading the file, I can't see the "scrollArea" span tag which should have been inserted, nor the CSS styles. Could it be because I am using osCommerce 2.2? The code looks a little bit different: $info_box_contents[] = array('align' => 'left', 'text' => '<a href="' . tep_href_link(FILENAME_SHIPPING, '', 'NONSSL') . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' . '<a href="' . tep_href_link(FILENAME_PRIVACY, '', 'NONSSL') . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' . '<a href="' . tep_href_link(FILENAME_CONDITIONS, '', 'NONSSL') . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' . $pdf . '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'NONSSL') . '">' . BOX_INFORMATION_CONTACT . '</a><br>' . $informationString Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.