cannuck1964 Posted July 5, 2003 Posted July 5, 2003 I would like to propose that a code change be implemented in the basic coding of the box structure. What I would like to see the team implement, is the removal of the HTML tags at the top and end of each box structure. Specifically the <TR> and <TD> at the top and the </TR> and </TD> at the end. I would like to see these tags be placed into the column left/right files. This is to acomplish several things. First it is more economical to place the repetitive code in one file verses a multitude of files. This code would be easier to modify being placed in one file, thus eleminating the need to change more then one file to make any html chages, ie adding in a <BR> tag or any other tag or html.. As well, by removing this and other parts of the code in the future, will enable point and click installation of new boxes, which will fit into any layout design, Having a similar functionality of the Post Nuke system, will give greater flexibility for layout designs being fully portable from one basic set of files... any thoughts on this would be appreciated. cheers, Peter McGrath ----------------------------- See my Profile (click here) for more information and to contact me for professional osCommerce support that includes SEO development, custom development and security implementation
burt Posted July 5, 2003 Posted July 5, 2003 If that was implemented it would be more difficult for a green user to remove out the unwanted infoboxes by // commenting them. If they did so, they would be left with an unused <tr><td> </td></tr> which would cause issues with some browsers and so on. A better proposal ( IMO only !! ) would be to do away with the existing method of creating infoboxes (classes creating nested tables), and use .css thus: <?php /* $Id: information.php,v 1.6 2003/02/10 22:31:00 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ ?> <!-- information //--> <tr> <td class="infoBoxHeading"> <?php echo BOX_HEADING_INFORMATION; ?> </td> </tr> <tr> <td class="infoBoxContents"> <?php echo '<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>'; ?> </td> </tr> <!-- information_eof //--> Stylesheet: .infoBoxHeading { font-family: Verdana, Arial, sans-serif; font-size: 10px; font-weight: bold; background: #eeeeee; color: #000000; border-top: 1px; border-right: 2px; border-left: 1px; border-bottom: 0px; border-style: solid; border-color: #cccccc; padding-right: 4px; padding-left: 4px; padding-top: 2px; padding-bottom: 2px; } .infoBoxContents { background: #eeeeee; color: #000000; font-family: Verdana, Arial, sans-serif; font-size: x-small; border-top: 0px; border-right: 2px; border-left: 1px; border-bottom: 2px; border-style: solid; border-color: #cccccc; padding-right: 2px; padding-left: 2px; padding-top: 3px; padding-bottom: 5px; } Thoughts ? Doing it this way makes boxes easier to change appearance quickly ( IMO )
cannuck1964 Posted July 5, 2003 Author Posted July 5, 2003 If that was implemented it would be more difficult for a green user to remove out the unwanted infoboxes by // commenting them. Actually, I was thinking more along the lines of implemnting or using a column controller system similar to Linda McGrath's contribution. By doing so, this would eliminate any need for the average non-programmer to edit the columns file, rather they would do this via an admin tool. If they did so, they would be left with an unused <tr><td> </td></tr> which would cause issues with some browsers and so on. not true, they would just have to comment these out as well, if a admin tool was not used.....the column file structure could be made so that these tags were done via php as well.. thus each tag would be done //start a box call.... echo '<TR> <TD>'; require (BOX . 'box.php'); echo '</TR> </TD>'; //end box call so now the person would just use /*.....box code......*/ A better proposal ( IMO only !! ) would be to do away with the existing method of creating infoboxes (classes creating nested tables), and use .css Well the css thing is interesting, but not many people are fully fluent in css design work. As well, doing the info box is pretty straight forward since it is a static type of box, what about the catagories box? is css easy to use to set this box up as well? The css solution might be a good way to work towards, but I think that using it fully in osc might be a fairly large under-taking.... Thoughts ? Doing it this way makes boxes easier to change appearance quickly ( IMO ) Well along the same line, I would like to see the layout of the box, (ie the infobox_heading and footing) be placed in the column files as well....thus the info_boxes will only contain the actual box contents, only the implementing php code for the box contents would be placed in the info box themselves. What this will do is allow for boxes to be created, which are plug and play with any type of layout, it will give the flexibility to add a box top and bottom images to give truely unique looks to any box. And will streamline the existing code more effeciently.... cheers, Peter McGrath ----------------------------- See my Profile (click here) for more information and to contact me for professional osCommerce support that includes SEO development, custom development and security implementation
cannuck1964 Posted July 5, 2003 Author Posted July 5, 2003 Also, I have noticed your box structure is different then MS1 is set up, has the team redone the box structure to reflect what you have or is this how you have set your boxes up? MS1 info box is different... <!-- information //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => BOX_HEADING_INFORMATION ); new infoBoxHeading($info_box_contents, false, false); $info_box_contents = array(); $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>' . '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'NONSSL') . '">' . BOX_INFORMATION_CONTACT . '</a><br>' . '<a href="' . tep_href_link(FILENAME_GV_REDEEM, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a>');//ICW ORDER TOTAL CREDIT CLASS/GV new infoBox($info_box_contents); ?> </td> </tr> <!-- information_eof //--> notice the leading html and ending html tags..... cheers, Peter McGrath ----------------------------- See my Profile (click here) for more information and to contact me for professional osCommerce support that includes SEO development, custom development and security implementation
burt Posted July 5, 2003 Posted July 5, 2003 I have stripped Osc right down and removed the class structure for all boxes...for me this is easier to change a sites look. Here is my categories box: <?php // removed lots of PHP and comments for this thread to make it readable ?> <!-- categories //--> <tr> <td class="infoBoxHeading"> <?php echo BOX_HEADING_CATEGORIES; ?> </td> </tr> <tr> <td class="infoBoxContents"> <?php // removed lots of PHP for this thread to make it readable echo $categories_string; ?> </td> </tr> <!-- categories_eof //--> I have stripped out the majority of the code, just for this thread. But it works in exactly the same way as any other box. .css is very simple. By doing this I have a w3 validated Oscommerce Shop, which has to be a good way forward. My next task is to fully change Oscommerce to xhtml but this is in the future sometime - it's not important just now.
burt Posted July 5, 2003 Posted July 5, 2003 <!-- information //--> <tr> <td> Pretty much the same as mine, this creates the bounding <td> which holds the contents: <?php $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => BOX_HEADING_INFORMATION ); new infoBoxHeading($info_box_contents, false, false); This bit uses the class infoBoxHeading to create a nested table, which though workable is not a good solution to create a border (which is all it does). $info_box_contents = array(); $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>' . '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'NONSSL') . '">' . BOX_INFORMATION_CONTACT . '</a><br>' . '<a href="' . tep_href_link(FILENAME_GV_REDEEM, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a>');//ICW ORDER TOTAL CREDIT CLASS/GV new infoBox($info_box_contents); ?> The above creates another nested table to contain the actual infobox itself. Again, this is unnecessary. </td> </tr> <!-- information_eof //--> Ends the opening tag, to prevent HTML spillage. So what this does is give exactly the same look as what I posted, but as you can see the solution I use is easier to understand, and is changable much more easily. Sorry if I'm teaching you to suck eggs - but for anyone else reading it migh tmake a bit more sense now (hopefully) :) notice the leading html and ending html tags..... cheers,
cannuck1964 Posted July 7, 2003 Author Posted July 7, 2003 So what this does is give exactly the same look as what I posted, but as you can see the solution I use is easier to understand, and is changable much more easily. Yes your css solution is very good, I do like the ease in which it works. It seems that any users when changing the box layout (template) would need to have a new css file made up, can a different file containing the css box info be used used for this? And have the call for the file put into the columns files? As well, you have solid colours in the heading, can this be changed with ease to use images instead? Can the css hold php code? If so, then to put the dynamics of the change in layouts might be achieved by putting in variables in the css definition of the box. Or use various info box definitions in the css file, all with different names (ie osc_info_box, bright_info_box ...etc). By doing this, then the columns file could contain the dynamics to make the info boxes change with ease.... The dynamics of getting info boxes, buttons, layouts, site text all sparate and editable via an admin tool is where I am looking to go with this... What I am envisioning, is the same box structure, which can use both top and bottom image "borders", without the need to change the class structure. The class structures do allow for dynamics that I am not sure the css does allows for, in css every box layout needs to be defined in a new css file/class, while in the osc class way of doing it, only the image file needs to be updated. Might be that the css file can be modularized/separated to include just the css box layouts.....the modularization would enable many different set-ups/layouts as well..... As well I was looking to use point and click installation, and I have a few ideas on how to achieve this.... Sorry if I'm teaching you to suck eggs - but for anyone else reading it migh tmake a bit more sense now (hopefully) I never suck eggs, but a good discussion on relevant topics are always worthwhile..... :wink: Peter McGrath ----------------------------- See my Profile (click here) for more information and to contact me for professional osCommerce support that includes SEO development, custom development and security implementation
burt Posted July 7, 2003 Posted July 7, 2003 It seems that any users when changing the box layout (template) would need to have a new css file made upWhy? You only need 1 .css file : stylesheet.css in which all the .css are defined. can a different file containing the css box info be used used for this? And have the call for the file put into the columns files?There is no need to do this. As well, you have solid colours in the heading, can this be changed with ease to use images instead?Yes.Can the css hold php code?Yes.If so, then to put the dynamics of the change in layouts might be achieved by putting in variables in the css definition of the box.Yes, this is how my style switcher works - the surfer presses a button to change a piece of php which then does some stuff in the .css file. Or use various info box definitions in the css file, all with different names (ie osc_info_box, bright_info_box ...etc). By doing this, then the columns file could contain the dynamics to make the info boxes change with ease....No need. Judicious use of php can easily solve this. The class structures do allow for dynamics that I am not sure the css does allows for, in css every box layout needs to be defined in a new css file/class, while in the osc class way of doing it, only the image file needs to be updated. No, .css is a million times more flexible than the present classes. From what you've written, you are going to deep, everything that you want to do can be done using .css - no need for modules, extra calls, classes and so on. http://www.w3schools.com/css/default.asp is a very good site for learning the basics of what .css can do. hth
cannuck1964 Posted July 7, 2003 Author Posted July 7, 2003 Hi burt, Yes I am learning css, and I will look over the page you sent me. Why? You only need 1 .css file : stylesheet.css in which all the .css are defined. Yes, this is how my style switcher works - the surfer presses a button to change a piece of php which then does some stuff in the .css file. this is fine, I was not sure fully on how the css used other scripting code...Can you post in here the code you use in the css file for this? I would really like to have a look at how the syntax is set up. No need. Judicious use of php can easily solve this. Perfect.....I want a straight forward solution, and if this is it, then fine......now can side images be added in too....I want the frame of the info box separate from the box contents... From what you've written, you are going to deep, everything that you want to do can be done using .css - no need for modules, extra calls, classes and so on. not really, I would perfer to examine it all now, and not have to revisit it after I found out that there are bugs in the design.....changing the box structure is a good first step to where I want to go..... cheers, Peter McGrath ----------------------------- See my Profile (click here) for more information and to contact me for professional osCommerce support that includes SEO development, custom development and security implementation
cannuck1964 Posted July 11, 2003 Author Posted July 11, 2003 Well I have been waiting a week or so for the css code you said you use.....do you not want to share it to the general masses? If not, this is fine.... can you make up a simple example of how the php code is placed into the css file......since the link you provided does not even talk about it.....Sharing is a wonderful thing.... :lol: cheers, Peter McGrath ----------------------------- See my Profile (click here) for more information and to contact me for professional osCommerce support that includes SEO development, custom development and security implementation
Guest Posted July 11, 2003 Posted July 11, 2003 can you make up a simple example of how the php code is placed into the css file......since the link you provided does not even talk about it.....Sharing is a wonderful thing.... :lol: Simple name your stylesheet something like styelsheet.php and open and close PHP calls normally. As long as the output is correct CSS, nothing will care about the extension. Just assign a content type of text/css when you use your link statement (which is required by valid X/HTML anyway).
cannuck1964 Posted July 12, 2003 Author Posted July 12, 2003 Thanks Wayne, I am still sort of new to this css stuff, but from what I have read it looks very interesting to use in a layout system....I am going to get a book to understand it more. I still have concerns on compatability issues, but I think that both osc and css layout systems could co-exist, sort of use the standard layout osc provides for browsers which do not support the more advanced features, and css for all others. Simple name your stylesheet something like styelsheet.php and open and close PHP calls normally. this is straight forward enough.....can more then one css file be used at the same time? by doing this, it might be easier to modularize the whole layout system, this would enable lots of variety...I also want to have a point and clic installation system built for installing different parts to the layouts.... So for example a shop owner wants the page to look one way, and the boxes to look another.....the admin tool will allow for this with point and click.... Just assign a content type of text/css when you use your link statement (which is required by valid X/HTML anyway). do you mean the way osc links in the css sheet in the header tag area? Does the css always need to be called in from this area or can it (if more then one is permissable) be done anywhere prior to where it is used in the layout? cheers and thanks. Peter McGrath ----------------------------- See my Profile (click here) for more information and to contact me for professional osCommerce support that includes SEO development, custom development and security implementation
rthrash Posted July 12, 2003 Posted July 12, 2003 I still have concerns on compatability issues, but I think that both osc and css layout systems could co-exist, sort of use the standard layout osc provides for browsers which do not support the more advanced features, and css for all others. Properly created CSS layouts work in NN 4.x. Are you concerned about earliers browsers? can more then one css file be used at the same time? by doing this, it might be easier to modularize the whole layout system, this would enable lots of variety...I also want to have a point and clic installation system built for installing different parts to the layouts.... You can have as many stylesheets as you want. So for example a shop owner wants the page to look one way, and the boxes to look another.....the admin tool will allow for this with point and click.... Good idea! Just assign a content type of text/css when you use your link statement (which is required by valid X/HTML anyway). do you mean the way osc links in the css sheet in the header tag area? Does the css always need to be called in from this area or can it (if more then one is permissable) be done anywhere prior to where it is used in the layout? I believe the CSS needs to be either written, imported or linked in the header. Imported styles are ignored by NN4.x... Hope this helps, Ryan Thrash Ryan Thrash
burt Posted July 14, 2003 Posted July 14, 2003 I have not had time until today to post. I assume that you are now sorted and can carry on doing your own thing. If you want to see my effort at doing a client-side style switcher in action, please PM me.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.