• I have read the numerous posts around the place, and have also looked in the ‘future’ section of the site. I noticed there is discussion of including the smarty based template system into WordPress..
    This will probably be the deciding factor for me, if I should move to WordPress or not from bBlog.
    I love the flexibility that bBlog has through its smarty-centric code, where you have functions such as {getrecentposts} as well as modifiers for your posts, such as textile, bbcode etc which can all be changed about easily in the templates.
    I’m not a huge fan of the current ‘template system’ in WP, if it can actually be called that. The plugins architecture, from what i have looked at is also something that lacks a bit (don’t get me wrong, its great, but i’m just inlove with the way bBlog and smarty handle things).
    For an example of what i am talking about, take a look at the following templates that I use on my site (powered by bBlog) (please ignore my sloppy html and use of tables – this is something i plan on fixing sometime soon!)
    https://surfionline.com/bblog/templates/surfi2/index.html
    https://surfionline.com/bblog/templates/surfi2/footer.html
    https://surfionline.com/bblog/templates/surfi2/archives.html
    I do know some people aren’t real fans of the smarty-centric or smarty based template system, however i see it has numerous advantages.
    Chris
    https://www.surfionline.com

Viewing 8 replies - 16 through 23 (of 23 total)
  • Smarty in WP, wouild be a deal breaker for me. Not to say I would stop using WP, I just wouldn’t upgrade past that point. I’ve worked with Smarty-Enabled systems before. It was royal pain. “takes about 5 minutes to learn” my arse – I spent a year “learning” it and still had problems. It may have been the implementation of the Smarty system within that system, but it became highly inflexible and hard to trace when debugging. And it left a bad taste in my mouth from the experience.
    As for index.php not being dynamic….. I can change styles with the flip of a switch, get something completely different and not have to change any thing anywhere else.
    If others want to use smarty, more power to them, but it isn’t form me. If WP ever does go smarty, I hope the developers will keep the rest of in mind an make it so that smarty is optional (or non-smarty is optional).
    TG

    If you only support php templates, then people who don’t already know php will have to learn it.
    And the same goes with smarty. But I think that the smarty syntax is easier to learn than the php syntax for beginners who don’t know either.
    But Smarty only comes into it’s own when you use it to it’s full potential. that is smarty based plugins , caching and functions. Example: Putting {getlinks cat=’blogs_i_red’} will get a list of links of the blogs you read and put them into your template. Also stuff like {$post.datetime|date_format:since} will output the post’s date and format using the ‘since’ style ( 3 hours ago etc)
    It means the templates tell the program what to display, not the other way round, making the program more efficent by not doing stuff that’s not shown in the templates.
    But to have something like that requires a modularized OO core . I did consider adding smarty to wordpress but I thought it would have been quicker to write a blogging app from scratch (bBlog) and that way I could take full advantage of Smarty. Just becasue I love smarty so much.

    Interesting discussion.
    I want to use wordpress as blogsystem but as other people mention it lacks for me of a template functionality. To edit the index.php or other “display” files isn’t very applicable or hacking the css.
    Furthermore it seems that class-smarty.php isn’t be updated (i think some basic wordpress functions are missing) but its not bad at all, its easy to update it.
    Is anobody there who’s running wordpress with smarty?
    P.S: Another good point of this discussion is to use a caching system (file and http)
    there was a discussion last two weeks about http caching headers
    https://alexandre.alapetite.net/doc-alex/php-http-304/
    if you interesting in this topic

    Why have ‘template tags’ when you’ve got PHP? Perhaps that’s why a lot of people switched from MT and from template tags.

    For the caching discussion: Have you ever tried the Statizice Reloaded plugin? Caching is done quite simple but it works.

    Thanks for your hint about the Statizice Reloaded plugin:)
    >Why have ‘template tags’ when you’ve got PHP?
    Well this is an endless discussion. Either you like the philosophy about templates (seperate design/code) or not.
    This is the same endless discussion with guys who like OO or the tranditional “function” way. The traditional guy will ask you why to use design patterns if the problem can be solve with e.g. 20 code lines…
    My intension is not to start a “flame war”. Maybe both variants (template/modifying php) can be supported in future, whereas the “traditional way” is default:)
    But my main question is, if anobody is running wordpress with smarty?:)

    When I started using b2 2 years ago, I wished it had a better template engine than it did. Using PHP functions, like it’s still done today in WP, leads to more cluttered templates. For me, that’s not an issue; I eat, sleep and breathe PHP. For someone like my girlfriend, or my dad, PHP is complex, confusing, and something they generally don’t understand, something they want to stay away from.
    What irks me more about using straight PHP functions is the fact that functions tend to change as the application grows. WP is no exception to that. That means that with every upgrade, I have to cross my fingers and hope that everything still works like it used to. Also, I have to make sure that nothing I changed is overwritten by the upgrade. It shouldn’t be like that, and it doesn’t have to be.
    Those that say that a template engine is “just replacing < ?php the_thingy ?> with {$thingy}” don’t understand the long-term benefits of a template engine. If you use {$post.title} instead of < ?php the_title(); ?>, it’s not about saving those few keystrokes. Who cares about a few keystrokes? You’ll only have to do that 1 or 2 times anyway.
    It’s about making sure that your template doesn’t have to change when the_title() does. For my girlfriend and my dad, that’s great news. For me, it means that I can upgrade all I want, and unless {$the_title} is somehow no longer assigned, I can leave my templates alone.
    Even better, since I use Smarty for other pages and things, I can really integrate WP with the rest of the site; I can use one, and just one, header file and just include that everywhere. Need to change something? Changing it in one file changes it everywhere.
    I’ve seen people say “You can use the shorthand < ?= ?> construction”. Well, yes, you can, if your server is configured to allow that; it doesn’t play nice with other XML < ? ?> constructs, which (for me, being my own web hoster) is a reason to disable it. Besides, it’s not about saving those few keystrokes. Another favorite seems to be “Smarty is difficult, evil, and it eats your children”. I’ve used Smarty for several years, and although it needed some “getting used to” (coming from another template engine which did things differently), I’ve never found it very hard to use. I like the fact that I can place “modifiers” on vars ({$var|uppercase}, for example), and that it caches the templates to PHP files. I also hear these “Smarty is slow” remarks, but not from people who’ve actually used it (not just “looked at it”, but really “used it”).
    However, nobody should be *forced* to use Smarty, or any other template engine, if they don’t want to. The best of both worlds for me would be having every function *return* it’s thing instead of just echoing it, of at least have a get_… version of each function. That way, I will be able to use template engine I see fit, and the “I want plain PHP”-types can use plain PHP. Everybody wins.
    Of course, I could write a getter function that just opens an output buffer, runs the specified function with parameters, and tosses back the contents of the output buffer. Don’t know what it would do to performance, though.
    Well, those were my lengthy 2 cents… =]

    Indeed, I agree with dille, including (getter) functions that return would make smarty support possible and give people the choice. I like the wordpress design a lot, but to nicely integrate it in my websites I would like to use smarty like on the rest of my pages.

Viewing 8 replies - 16 through 23 (of 23 total)
  • The topic ‘Smarty coming soon?’ is closed to new replies.