cormullion, please take a look at how Route.Static works:
It will match all files that end in VIEW_EXTENSION, and your source page does as well. Therefore if there are any "code islands" (i.e. stuff that comes after OPEN_TAG: <%) then that will be interpreted as newLISP code and it will be evaluated.
If you don't want that file getting sent through eval-template then there are several things you can do:
- Update your .htaccess file with a RewriteCond to prevent files ending in .src.html from being sent to the index.cgi script. This requires knowledge of .htaccess files (search google for mod_rewrite).
- Do it instead through a custom route that checks if the QUERY_STRING represents one of your source files and then simply pass it through the 'display-file' function. Make sure this route is added to the front of 'DF:dragonfly-routes' so that it gets evaluated before Route.Static.
- Change your VIEW_EXTENSION to something else (and change all your template files as well to that other extension).
In a future version of Dragonfly we could probably add a hook to Route.Static that will allow you to define a function that determines whether the file should be passed through display-view or display-file (as the former sends it through eval-template and the latter doesn't), but for now your easiest solution is to add a custom route, which isn't difficult to do (again, the docs really help you here).
EDIT: Whoops, that's DF:include, not DF:display-file. DF:display-view calls DF:display-file which calls DF:eval-template. Apparently I don't know what my own code does. :-p
Last edited by itistoday
on Tue Nov 17, 2009 2:17 am, edited 4 times in total.
Get your groove on.