[wp-hackers] Easytags template system
Matt Mullenweg
m at mullenweg.com
Wed May 10 00:36:18 GMT 2006
Came across this today:
http://businesslogs.com/reviews/movable_type_vs_wordpress_my_opinion.php
It's generally complimentary, but raises the oft-repeated point that
people get scared by <?php ... ?> even though most templating systems
are functionally equivalent to PHP. (Which I think can be very true.)
So I thought I'd throw out an idea I've had baking for quite a while but
haven't gotten around to coding: easytags.
Basically the concept is that it's very easy to parse something like
<$the_title$> into <?php the_title(); ?>. What if there was a plugin (or
in WP core) an option that gave you a "friendly" view when editing
templates? On display it could hide all the scary PHP it knows how to
parse behind psuedo-HTML tags, and on save turn it back into the PHP
that WordPress knows and love.
Version two could have friendly arguments, so <$the_title before="yo"$>
maps to the proper function calls. (This would be easier if we had a
parse_str or array equiv for all functions with multiple arguments.)
Version three+ doesn't need to be restricted to any one particular
syntax. WordPress says <?php potato(); ?>, MT says <$$$potato$$$>,
Blogger says <$potatospot$>, and Greymatter mumbles something under its
breath about the potato famine... why not let people choose what style
they want to use -- or even better yet natively support templates from
other systems. It's just another set of regexes. All of a sudden the
switching costs to WordPress just dropped as low as we could feasibly
take them.
Obscure systems could be support in plugins, it's all just a filter anyway.
There is no additional overhead to WP because it's all stored as PHP at
the end of the day (and for every page load). PHP or tags that aren't
supported could just be left as-is. It doesn't need to be perfect, just
to cover the 80% of each system that people actually use.
--
Matt Mullenweg
http://photomatt.net | http://wordpress.org
http://automattic.com | http://akismet.com
More information about the wp-hackers
mailing list