<html>
<font face="Arial, Helvetica">I flailed around with template URLs this
week and finally got it straight in my mind (and working in my
application), so I thought I'd document it for the list archive. If I was
smart enough to setup DocBook, I'd contribute this to the documentation
project, but that will have to wait for another day.<br><br>
Thanks to Ed McNierney and Stephen Lime for helping me out so
much.<br><br>
A TEMPLATE can be either a File or a URL. MapServer examines a template
definition, decides&nbsp; whether you have specified a File or a URL, and
responds accordingly. For example;<br>
&nbsp;&nbsp;&nbsp;&nbsp; “Display_Results.html”<br>
looks like a file and so will be processed as a file, but <br>
&nbsp;&nbsp;&nbsp;
“<a href="http://www.some_domain.com/Index.html”looks" eudora="autourl">http://www.some_domain.com/Index.html”<br>
looks</a> like a URL and so will be processed as a URL, which is quite a
bit different than how a File is processed.<br><br>
If MapServer decides that it has a file template, it goes through the
file and replaces stuff within [] with appropriate data. If the template
is a URL, however, MapServer redirects to that URL. The URL might be on
the same server, or another server. Although MapServer can not process
the file pointed to by a URL, it does process the URL string itself. For
example:<br>
&nbsp;&nbsp;&nbsp;
</font><a href="http://www.tetonwyo.org/clerk/query/default.asp?pidn=[PIDN" eudora="autourl"><font face="Arial, Helvetica" color="#0000FF"><u>http://www.tetonwyo.org/clerk/query/default.asp?pidn=[PIDN</a>]<br>
</u></font><font face="Arial, Helvetica">MapServer will replace [PIDN]
with an appropriate value before redirecting to the new location. Note
also that you can go to an Active Server Page, or other not-purely HTML
type location. (To me, this is really sweet, because it allows you to
easily mix CGI MapServer with other web technologies.)<br><br>
Okay, so you read this far and I still haven't told you anything that you
didn't already know, but here’s what had me flailing. A template can only
reference a URL in a SINGLE query mode. So if you are in a MULTIPLE query
mode, e.g. nquery, MapServer only attempts to processes the template as a
file. Not a good thing if you specified a URL, but still entirely
logical. A URL is intrinsically a single thing, and you can't
simultaneously redirect a browser to multiple locations. In other words,
MapServer assumes that if your query could potentially return more than
one result, that you would have specified a File for the template, not a
URL.<br><br>
So that’s the most interesting thing I learned this week. <br><br>
Happy mapping,<br>
Rich<br><br>
</font><x-sigsep><p></x-sigsep>
Richard W. Greenwood, PLS<br>
Greenwood Mapping, Inc.<br>
Rich@GreenwoodMap.com<br>
(307) 733-0203<br>
<a href="http://www.greenwoodmap.com/" eudora="autourl">http://www.GreenwoodMap.com</a></html>