From: Ryan S. <rya...@us...> - 2006-03-18 21:29:25
|
On Mar 18, 2006, at 15:39, Gianluca Sforna wrote: > IIRC , the statement that mantis is planning to move toward a > templating engine is on the web site from quite some time, without no > apparent sign of work on the issue. > Now, not that I have something agains Smarty or any other templating > engine, but I feel that the current web trends are not in that > direction anymore. > > What I see, is an increasing use of standard compliant (X)HTML and CSS > code to produce the final design; having a standard XHTM 1.0 oupout > from mantis is, IMO, the way to go for reaching the templating goal. > This way, you will only have to drop in your desired CSS and the trisk > is done... > Mantis web site could also feature a user contributed styles section, > along the lines of csszengarden.com Despite the increasing prevalence of CSS-based layouts, there is still a great benefit to separating presentation from logic, which is something you can do with Smarty. You could of course do it with just PHP instead, but in one of our internal projects where we tried this, since it was technically possible to put logic code into the template file or HTML code into the logic file, this inevitably kept happening. With Smarty configured to disallow PHP code in templates, this can't happen, and the fact that Smarty is its own language helps to enforce the separation. Or, you just need more discipline than we had. In our newer projects, we're using Smarty even in projects with no ability to change the look, simply for the benefit of separating logic from presentation. (Unfortunately, the ability to accurately mentally separate business logic from presentation seems to be irrevocably absent from some of our programmers....) Hopefully you will also admit that CSS still comes short of being able to do many things to a page's layout. Inevitably I find that I have to add random divs here and spans there to be able to construct the look in CSS that I want. If Mantis doesn't have templates but just a single "well-designed" CSS-ready layout and switchable stylesheets, it's doubtful that the Mantis programmers could plan ahead so well as to anticipate the needs of all theme designers. And adding a div or a span here or there after the fact to accommodate some particular future stylesheet is sure to break some previous stylesheet written when that div or span wasn't there. For these reasons I would therefore still be in favor of having a template system in Mantis, be it Smarty or a dilligently-supervised simpler solution in pure PHP. However, due to the way Mantis is currently programmed, I am doubtful that such a conversion could ever take place without needing to rewrite a significant portion of the project from scratch. It would, at the very least, require enormous effort and coordination. I also don't think I'd feel comfortable attempting such an undertaking while the project is still backed by CVS, which can't track file renames, which will probably inevitably come up in such a major restructuring. Subversion, which I would otherwise gladly suggest as a replacement, also does not have reasonable renaming support at this time, unfortunately. For those interested, this is the ticket under which this enhancement is being tracked: http://bugs.mantisbt.org/view.php?id=4227 |