views:

112

answers:

1

I have 2 collections of asp files that are auto generated by a job. Collection 1 has a virtual path of "/collection1/" and collection 2 has a virtual path of "/collection2/". Both collections have the same asp code:

<!-- #include file="../SSI/Template.inc" -->

Inside Template.inc I have some typical html templating. However, I'd like collection 1 to have a different template than template 2. So my question, can my include file determine what page just called it so I can do a simple if statement and display a different template?

The easiest way may seem to change the job to render different asp, but this is not an option.

edit - I can add a handler for .inc to go to classicasp.

+2  A: 

As you say your collections are located in different virtual paths. So, you can check the URL of your page (using server variables) and render according to the path.

E.g. the following could be placed in the ../SSI/Template.inc:

if instr(Request.ServerVariables("URL"), "/collection1") > -1 then
  'render html for collection 1
else
  'render for collection 2
end if
Michal