HTML template naming

Stephen Lime steve.lime at dnr.state.mn.us
Fri Mar 16 12:29:11 EST 2001


We just need to expand the regular expression that governs template extensions. Find the
line in map.h and change:

#define MS_TEMPLATE_EXPR "\\.(wm|htm)l?$"

to

#define MS_TEMPLATE_EXPR "\\.(wm|htm|phtm)l?$"

Just for clarification, I haven't used PHP much, but I didn't think it was possible for mapserver
output (i.e. parsed templates) to be parsed again by php or anything else before the client
recieves it. That's why .wml, .html, and .htm where the only allowed template types. There was
an Apache module to allow SSI in CGI output but I never tried it. I could be way off base though,
could somebody confirm that?

Steve

Stephen Lime
Internet Applications Analyst

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937

>>> Thorsten Fischer <thfischer at mapmedia.de> 03/16/01 10:58AM >>>

Dear list,


I noticed that HTML templates in the WEB section have to be named with a .html
suffix. That means,

WEB
  TEMPLATE template.html
  [ ... stuff .. ]
END

will be accepted my mapserver, but

WEB
  TEMPLATE template.phtml
  [ ... stuff .. ]
END

will throw the following error:

Content-type: text/html returnHTML(): Web application error. Malformed template
name.

My question is: is this a desired behaviour? Some webservers are configured to
let php code be executed from .phtml and/or .php files only. What am I to do
if there is code that must be executed in my .phtml templates?

I did not check if the same restrictions apply to the header and footer
directives as well, but I guess that they use the same template name parsing.


Thorsten

-- 

Thorsten Fischer          thfischer at mapmedia.de 

---------------------------------------------------------
MapMedia - Kartographie und raumbezogene Informationssysteme
Am Borsigturm 42
13507 Berlin
Deutschland
http://www.mapmedia.de tel: +49 (0)30 43032102
---------------------------------------------------------






More information about the mapserver-users mailing list