search results with templates

Post Reply
User avatar
Thunderstone
Site Admin
Posts: 2504
Joined: Wed Jun 07, 2000 6:20 pm

search results with templates

Post by Thunderstone »



Hello,

I was wondering if anyone has written any Vortex/Webinator scripts that
display search results in HTML templates, as opposed to having the script
construct search results page right there is the script itself.

After reading through Vortex manual and seeing all the functions for
manipulating strings (concatenation, search and replace, substrings, regular
expressions, etc.) I think it would be possible to make HTML templates with
some predefined tags in them, have the Vortex script read in that template,
do the database querying, and then put the results of the query in the HTML
template in place of some tag that marks the spot for search results.

I've done the same with Perl CGIs and Java Servlets and found it to be
cleaner because it separates the design from script logic/operations, which
means you can have an HTML person change the look and feel of search results
page without having to mess with the search script (sensitive).

Has anyone done this and is willing to share experiences and/or code/logic,
or do I have to start from scratch?

Thanks,

Otis
P.S.
can anyone see any drawbacks to this approach? I can see only 1 so far - the
template file needs to be read for every single query (unless I put the
whole template in some variable inside of the search script and save it from
file open and reading)



User avatar
Thunderstone
Site Admin
Posts: 2504
Joined: Wed Jun 07, 2000 6:20 pm

search results with templates

Post by Thunderstone »



Dear Otis (and group),

This is contrary to our philosophy in general. In our humble opinion
templates are ok for simple applications on low to medium hit rate
servers, but we designed Vortex for the other end of the spectrum.
Our OLD stuff used to work the way you describe below, and it just
too cumbersome to maintain a complex app that had bunch of separate
templates and program entry points while trying to keep user-state
intact. We don't have a lot of interest in going back to this.

If this is how you view Vortex, then we think you should give it
a chance and code in it for awhile before making up your mind.
Most people who program with it for any amount of time really like it.

Thunderstone




Post Reply