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.
Thursday, March 18, 2010
Updated Email Customer's Receipt example
I updated the "Email Customer's Receipt" example considerably. It retrieves business, receipt header, and receipt detail information from a SQL Server database.
I made most of the changes to the ASP code, and added T-SQL code to create tables and insert data into the example db_dermistest database. I included some code which should prevent SQL injection, as well.
If you're interested in a fairly complete example of using Dermis to email an invoice with information pulled from SQL Server, there you go. I hope it proves useful to you!
I made most of the changes to the ASP code, and added T-SQL code to create tables and insert data into the example db_dermistest database. I included some code which should prevent SQL injection, as well.
If you're interested in a fairly complete example of using Dermis to email an invoice with information pulled from SQL Server, there you go. I hope it proves useful to you!
Thursday, March 4, 2010
Updated Docs Again
I corrected the Fetch method bug, and re-ran all of the simple, advanced, and email examples to make sure they work.
Also, I added documentation on how to create a test database, database user, and database login. I used SQL Server 2005 Express. You can use your own database and authentication, of course, but if you're creating a development server or VM, having the steps right there should shorten the time it takes to get right to developing. I included a lot of screenshots, too.
I also re-structured the documentation directories.
Perhaps I should add some more screenshots on Sourceforge ... :)
Also, I added documentation on how to create a test database, database user, and database login. I used SQL Server 2005 Express. You can use your own database and authentication, of course, but if you're creating a development server or VM, having the steps right there should shorten the time it takes to get right to developing. I included a lot of screenshots, too.
I also re-structured the documentation directories.
Perhaps I should add some more screenshots on Sourceforge ... :)
Friday, February 26, 2010
Bug with Fetch Method
I realized last night that I hard-coded the Fetch method to use localhost instead of the current webserver's name.
I am working to correct this now.
I will also re-run the simple, advanced, and email examples to make sure they work.
I am working to correct this now.
I will also re-run the simple, advanced, and email examples to make sure they work.
Subscribe to:
Posts (Atom)