Title: Smarty
Last modified: August 18, 2016

---

# Smarty

 *  [alex](https://wordpress.org/support/users/alex/)
 * (@alex)
 * [22 years, 7 months ago](https://wordpress.org/support/topic/smarty/)
 * WordPress has its own…bespoke templating system right now, it’s not hugely nice
   or efficient or easy to use, Smarty is good, Smarty is nice, Smarty seperates
   code from interface. Yum. I also believe someone else if working on Smarty development
   atm.
    However the existing functions (the_content(), the_author() etc) are not
   really in keeping in the Smarty-way-of-doing-things. And as such, merely writing
   a Smarty wrapper for the existing templating functions isn’t what you should 
   really be doing. Instead, a rethink on the templating system would be much better.
   I am an OOP whore. And hence i suggest that we use either associative arrays 
   as the primary method of displaying data through Smarty. These objects will have
   all the nice pre-processing done already. They will be accessed either using {
   section} or {foreach} within smarty. E.g. {foreach from=$posts item=post} <h3
   >{$post.title}</h3> {$post.content} {/foreach} You get the idea I hope. For fancy
   stuff like calendars, or possibly even permalinks and such custom functions and
   variable modifiers will be used. E.g. {archive_calendar} or {$post.id|permalink}
   or {$post.author|mailto} I don’t have time to draw up an entirely descriptive
   design for this, but i hope you get the general idea of what im saying. the_content()
   is bad and evil and will eat your children if you dont watch it carefully.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [rayne](https://wordpress.org/support/users/rayne/)
 * (@rayne)
 * [22 years, 6 months ago](https://wordpress.org/support/topic/smarty/#post-26295)
 * I totally agree with this idea. Having the ability to use the loops that smarty
   supplies, the user has more flexibility in how they set up their pages. This 
   will be especially useful to those users who are switching from Movable Type 
   and are used to having maximum flexibility in their templates.
 *  Moderator [Matt Mullenweg](https://wordpress.org/support/users/matt/)
 * (@matt)
 * [22 years, 6 months ago](https://wordpress.org/support/topic/smarty/#post-26296)
 * You get more flexibility in Smarty than PHP? I think not. Smarty can be as flexible
   as PHP, but then you end up with just a metalanguage on top of PHP whose main
   advantage is having curly braces instead of opening and closing PHP tags. If 
   we were to do a post loop, we would probably have a custom block function, so
   like:
    `{posts cat="1" last="10"} <h2>{$title}<h2> {/posts} Or something of the
   like. Thanks for your comments.
 *  [alexkingorg](https://wordpress.org/support/users/alexkingorg/)
 * (@alexkingorg)
 * [22 years, 5 months ago](https://wordpress.org/support/topic/smarty/#post-26361)
 * Re: foreach loops – you recognize we have a foreach loop for the posts and the
   comments already, correct?
 *  [lars](https://wordpress.org/support/users/lars/)
 * (@lars)
 * [22 years, 5 months ago](https://wordpress.org/support/topic/smarty/#post-26366)
 * I agree with allusion and Moose.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Smarty’ is closed to new replies.

 * 4 replies
 * 5 participants
 * Last reply from: [lars](https://wordpress.org/support/users/lars/)
 * Last activity: [22 years, 5 months ago](https://wordpress.org/support/topic/smarty/#post-26366)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
