I've had some very positive feedback and questions, which is great, but this blog isn't built for feedback. So, as of today, the official Dermis forum is:
http://forums.williammeitzen.com/
This is my personal website, so please don't do anything you shouldn't.
Also, I'll be transitioning away from using this blog to the forum.
Some of you have expressed gratitude ("Thanks for your AWESOME templating engine!" and such), which I am humbled by. You can post such kindness on the forum now. :)
Monday, April 19, 2010
Thursday, April 15, 2010
New Example
At the request of an anonymous post, I created an example for a very simple forum reader.
You can find it in Dermis' documentation, under Simple Examples / Simple Forum Reader.
It shows the entire list of categories, with the first three articles under each category.
Its layout leaves a lot to be desired, but the essentials are there.
You can find it in Dermis' documentation, under Simple Examples / Simple Forum Reader.
It shows the entire list of categories, with the first three articles under each category.
Its layout leaves a lot to be desired, but the essentials are there.
Wednesday, April 14, 2010
Updated
Perhaps I spoke too soon.
I added a (sub) assign command and a (function) get_template_vars command to the required_include.asp file, effectively making it visible to the template that is running.
This new functionality will be useful to those making large templates. It will be nice to make template files do some work for themselves, rather than the calling script.
What's funny is I came up with a solution while writing the previous post. It's odd that you can come up with a solution while trying to define exactly what the problem is.
I didn't document it extremely well, mainly because the Dermis methods are named the same as the sub and function, which may make it confusing at first. I might change that.
See the "email customer's receipt" code for an example.
I added a (sub) assign command and a (function) get_template_vars command to the required_include.asp file, effectively making it visible to the template that is running.
This new functionality will be useful to those making large templates. It will be nice to make template files do some work for themselves, rather than the calling script.
What's funny is I came up with a solution while writing the previous post. It's odd that you can come up with a solution while trying to define exactly what the problem is.
I didn't document it extremely well, mainly because the Dermis methods are named the same as the sub and function, which may make it confusing at first. I might change that.
See the "email customer's receipt" code for an example.
New Features
For the last few days, I've been working on a way to include an ASP script into a template. The idea is for the template to be able to retrieve the information it needs instead of relying on the calling script.
Let's take the invoice example from the Dermis documentation. Right now, the calling script must give the template the business' name, address, email address, and phone, as well as the invoice detail. It makes more sense for the calling script to only give the template the invoice detail, and for the template to retrieve the business' name, address, email address, and phone for itself (at least to me).
So far, I've created a command which takes advantage of the fact that templates are compiled before they run. "$dermis.infix.application_directory" will be utterly replaced by the directory part of request.servervariables("url"). This will ensure that the script will run in the directory the calling script is in:
{* start of template code *}
<!--#include virtual="$dermis.infix.application_directory/retrieve_business_info.asp" -->
{* end of template code *}
I saw no similar command in Smarty, so I created one. "infix" (verb form) seems to be a good command to create. If you have a better term, feel free to email me!
The hard part is figuring out how to let the included script (retrieve_business_info.asp) retrieve and change the template variables. I'm still working on that.
Let's take the invoice example from the Dermis documentation. Right now, the calling script must give the template the business' name, address, email address, and phone, as well as the invoice detail. It makes more sense for the calling script to only give the template the invoice detail, and for the template to retrieve the business' name, address, email address, and phone for itself (at least to me).
So far, I've created a command which takes advantage of the fact that templates are compiled before they run. "$dermis.infix.application_directory" will be utterly replaced by the directory part of request.servervariables("url"). This will ensure that the script will run in the directory the calling script is in:
{* start of template code *}
<!--#include virtual="$dermis.infix.application_directory/retrieve_business_info.asp" -->
{* end of template code *}
I saw no similar command in Smarty, so I created one. "infix" (verb form) seems to be a good command to create. If you have a better term, feel free to email me!
The hard part is figuring out how to let the included script (retrieve_business_info.asp) retrieve and change the template variables. I'm still working on that.
Subscribe to:
Posts (Atom)