Forum OpenACS Q&A: Newbie Alert: ADP vs TCL
What is the basic difference (aside from the extensions) between ADP and TCL scripts in the OpenACS environment?
So you can use either one, but if you have more HTML than Tcl you'll find it more convenient to use .adp, and vice versa.
If you're writing .adp, you have to enclose the Tcl in special tags. If you're writing .tcl you have to explicitly write the HTML/text output to the client connection (eg. using ns_write. You have to remember to quote the double quotes within .tcl output.
The aolserver web site has more details.
Good luck with the problem sets.
<% set somevar [some_tcl_function somedata] %> <html> <body> <%=$somevar%> </body> </html>
.tcl starts life as a tcl script and then outputs html
ReturnHeaders set somevar [some_tcl_function somedata] ns_write "<html> <body> $somevar </body> </html> "
Or you could see the .adp files as the templates where you store your design and layout and the .tcl files where you store your logic. In that way you achieve the holly grail of CMS of separation of content/logic/layout.
I prefer to see it that way so that as soon as you start coding you have that idea in mind and it's really important (at least I like to think so ;)
It's not less important for that, but Rick should understand that AOLserver by itself doesn't support this presentation/computation separation.
So .... Rick ..you should use one of the [Open]ACS templating mechanisms! Even if you don't use the rest of the toolkit.