This topic is locked

Conditional template

12/22/2004 11:29:47 AM
ASPRunnerPro General questions
D
dheydt author

Sergey,
Is there a way to use part of a template only for one particular table?
I've been making lots of changes to the templates to make the formatting look like an already existing web site. I have one table that needs a special modification to make the SQL produce the desired results.
If I modify the table's_list.asp file then when I rebuild the project (to incorporate template changes) I lose my modification. On the other hand, if I modify the template, all tables get the modification. Also, I could create a seperate template for just this table but then I would need to make template changes to two templates everytime (a lot of work!).
Any suggestions on how I could make something conditional in the template. Something like, "if the table = 'xyzTable' then sql = sql + 'mod'".
Thanks for your help.
Dan

Sergey Kornilov admin 12/29/2004

Dan,
you can use something like this:

if strTableName="Order Details" then

response.write "We are here"

end if


This is not a real conditional template however it should work. strTableName is the variable that holds current table name.