MyBB Ideas
The MyBB Ideas site allows users to suggest new features and changes in MyBB and the MyBB Group to easily review them to decide what direction MyBB should head in. Search existing ideas.
Smarty (like) Template System
|
12 votes
|
I always thought the template system of MyBB was great. I even created my own template system based on the MyBB template system to use in my own sites. Until I started using Smarty! A new world opened up for me. What I'm trying to tell is that MyBB can also profit of using the Smarty Template Engine or a Smarty-like system (but why reinventing the wheel?). Why ? Well, in the first place it will produce less (or even none) html in the hard-coded php files. And secondly, when there is no extra html "baked" into the core, it offers admins more control over their templates. We tried changing the templates on our MyBB board to templates that don't use tables, but it's impossible because there is a lot of html that is generated by the core.
|
10 Comments
-
luke83, 8th June 2007, 9:12:10 PM
http://smarttemplate.sourceforge.net/ is the one i use the most.. to have system like smarty or smarttemplate as template engine/compiler can simplify the coder <-> designer work.. so that the coder have to "build" necessary arrays and the webdesigner just have to complate (x)html structure with some comment tag to "loop" pre-setted arrays :D
very usefull as template system and i think smarttemplate is the best with last releases!
-
Grom, 9th June 2007, 1:59:24 AM
Smarty is old and not good. Better look to Open Power Template http://opt.openpb.net/features.php . This is the best template system what I know. It supports XML based syntax and many others cool features. Look yourself :)
-
Aries-Belgium, 9th June 2007, 8:57:04 AM
@luke83: I looked at the docs of SmartTemplate, but it looks a bit too simple in comparison to Smarty. Smarty has a lot more usefull features and it has more buildin functions.
@Grom: Any arguments why Smarty is not good ? And old ? From what I can see, there are updates of Smarty on regular bases.
-
CraKteR, 9th June 2007, 10:30:18 AM
What I've heard before is that Smarty templates are slow. Ours is not. I haven't actually used it myself but that's what I heard.
-
Aries-Belgium, 9th June 2007, 12:46:14 PM
@CraKteR: when enabling caching it's not that slow. When it needs to parse the templates every time, I guess it's a bit slower. It will automatically check if a template is updated and it will update the cache as well. I'm using Smarty for a few projects of my own and I don't had performance problems this far.
-
CraKteR, 9th June 2007, 6:59:53 PM
I just downloaded smarty and looked a bit around on it. It seems like a nice class. but I think it's a bit overkill as a class for us. I think our template system is good how it is now. Although it probably could use some improvements.
But Smarty seems a little bit overkill. Also it seems a little complex for our ´normal´ users that just learned HTML. -
Aries-Belgium, 9th June 2007, 7:16:51 PM
I think when someone is willing to change the default template, he would be willing to learn a bit of extra syntax. An example of how the end-user would have more control over its templates. When a user wants to display a text in capital letters he can do that with the upper modifier of Smarty:
--- CODE ----
{$variable|upper}
--------------You could also solve this by using CSS, but that's more text and so more bandwidth.
Another thing I think would improve is speed and database usage because you can decrease the amount of templatebits.
--- CODE ----
<table>
{for in=$posts item=post}
<tr>
<td>$post.username</td>
<td>$post.message</td>
</tr>
{/for}
</table>
-------------With the MyBB templatesystem this would be two records (storage) and two queries (speed).
-
Ryan Gordon, 10th June 2007, 3:48:43 AM
Smarty is powerful, but slow. I would prefer using a separate conditionals system.
-
labrocca, 25th June 2007, 6:04:43 AM
I am NOT a fan of systems that use Smarty. Smarty is great for a project that's custom for a single site..however..for a project like mybb. I also agree that it's overkill. And tearing about mybb just to add smarty seems more trouble than it's worth at this point.
Remember that mybb is a forum...it's not a site where elements are moved around very much.
-
forevagrey, 20th February 2008, 1:51:46 AM
we should not go to this extreme, we should try to simplify our end before going to using a third party add on.
Post a Comment
Before you can post a comment you must be a registered member of the MyBB Community Forums.
If you already have an account, log-in to it to post a comment or if you don't register a new account.