PHP template assembly glue engine

Wednesday, March 29, 2006

Clear some things up.

I've been reading some of the blog posts in response to the tag-Engine presentation last night and I just thought I'd clear some things up for those that are confused or don't understand how this differs from the smarty engine.

Let me paint a picture of how tag-Engine can be used to make life easier for someone who doesn't know how to program in PHP.

Imagine a form used for submitting articles and the writer wants to add an image to the article. Now imagine that next to that article form is a search form that lets you search through the images table by their tags. The writer finds an image and clicks on it. When they click on it it adds a tag to the article like {img[32]} where 32 is the ID of the image. Simple enough right?

Now let's imagine they want to add a poll to their article. They create the poll in a seperate form and to add it to their article they simply add the tag {poll[44]} where 44 is the ID of the poll. How is that for convenience, accessibility and flexibility for the writers?

Now let's look at a more common problem with template systems like modules/widgets. Think of a module on a traditional template sytem that calls a list of articles. Typically the module outputs to a template where the webmaster can move variables around to "customize" the appearance. However this is simply customizing the appearance of a template the programmer has already designed. What if the webmaster wants the top 3 stories to have images and special div boxes around them? Assuming they know PHP they would need to edit the module's code and it'll most likely be an ugly hack.

With tag-Engine the results are called in the template. So you can do the following...



{loop[1|3]:}
<div id="special">
{counter[$x]}
{db.src[$articles|$x|article_title]}
{db.src[$articles|$x|article_splash_id] set[$imgid]}
{img[$imgid]}
</div>
{:loop}

{loop[4|($num_results - 3)]:}
<div id="normal">
{counter[$x]}
{db.src[$articles|$x|article_title]}
</div>
{:loop}



As you can see there is no limit to the format in which data can be displayed in your templates.

I hope that clears things up a bit for everyone. If you have any questions please post them in the comments section or send me an email to joshdavey@gmail.com. Thanks!

Technorati tags: , ,

4 Comments:

Anonymous Anonymous said...

Hey Joey,

It definitely does look interesting, and I think I get the concept behind it a bit better now. Can't wait till I get to play with it a bit :)

-Randy

Wed Mar 29, 01:53:00 PM

 
Anonymous Anonymous said...

Sorry! Josh! My mind is completely messed.

Wed Mar 29, 01:54:00 PM

 
Anonymous Anonymous said...

hey man, excellent work last night. The debugging interface you've come up with is especially keen. keep it up!

Wed Mar 29, 03:24:00 PM

 
Anonymous Anonymous said...

damn, i wish i knew you so i could get ahold of this cool deal!!! well, good luck though you dont know me bye bye now.

Thu Jun 01, 07:36:00 PM

 

Post a Comment

<< Home