some updates and clarification

pngwen <[email protected]> 1 Aug 2003 14:23:22 -0000
Newsgroups gmane.comp.web.oscommerce.devel
Message-ID <9cba938f730f8b46bfc09d211f6d8ae3@osCommerce-Forums>
This message was sent from: Development
http://forums.oscommerce.com/viewtopic.php?p=205634#205634
----------------------------------------------------------------

Some have said it would take a fundamental rewrite, this is not the case.  However, there are some core pieces of osc's display logic that will  have to go away.  Not be rewritten, just taken out.  This is why this probably can't be a bolt on module.  I may look into it, but I doubt it can be done that way.  I promise you though, it will be nice :-)

Some have said it will be comparable to the php stuff, and that's true, but only to an extent.  The case is, html formatting and output functions will simply be removed and all that formatting is now being done in smarty templates.

Under the current system if a designer wanted to make a  FUNDAMENTAL change to the way the site looks, he could not without editing php classes such as the textBox class or the infoBox class.  With a template like I'm doing it would just be simple html editing.

Also, I want to address a concern about smarty's performance.  Smarty does NOT parse the template on every page view.  It parses the page and creates a sort of "compiled" page, which is a php representation of the template.  In other words, it's changed into php code on the fly.  If the timestamp of the template is later than that of the php file it is recompiled, thus it only has to parse once per template modification.



Anyway, now that I got that out, here's how my conversion is going.

I have converted the entire header, the front  page layout, and the left column navigation section.  It's all very modular and a designer can easily change how the look of the site goes up to that point.  After that it is still going through all the php html formatting stuff that osc uses.  

It has actually proven very easy to do this, the layout of the system is very straightforward, and for this I think the osc team should be commended.  This is really more of a subtractive effort, moving the display to templates.  I am still keeping the settings that affect the display in and I am making sure that they are honored in the default templates.  I plan on finishing the initial templating of the site sometime next week.  I won't have any of the code cleaned up by then, so if you look at the php files there will be a lot of commented out code, the point of what we'll have to look at next week will be to play with the templates and prepare to proceed with the final conversions.

Also, I plan on writing some extensive documents on modifying the templates in a way that still honors the settings of osc.  

Oh, and one last issue.  The issue of a programmer "learning" smarty is very small.  There really are only about 10 or 15 function calls.  The programming end of smarty can be fully mastered in an afternoon.