The templates are not directly accessible as html files. They are web2py view files and must be processed server-side by web2py before sending a response to the browser. If you want to apply a completely different view to the current page, you'll probably have to reload the page. Note, if you just need to alter part of a page, you could do it via an Ajax call (possibly using web2py components: http://web2py.com/book/default/chapter/13#Components).
Anthony On Thursday, October 13, 2011 10:04:30 AM UTC-4, Matt wrote: > > Hello, > I am trying to dynamically load templates that I have stored in a > subdirectory of one of my views. The structure looks like this: > > app/ > views/ > test/ > index.html > list.html > edit.html > add.html > templates/ > first.html > second.html > > > (I hope that formatting is preserved..) > I have this set up because I want to show different "profiles" for > each "test" item - this is a composition. For edit, this works just > fine, in the template I use include to import the proper template > based on the type of the member variable. The problem I face now, is > that in "add" I want to have a select box that loads the proper > template, but have no idea how to actually load this file from the > browser-side (this seems the only solution, without having to reload > the whole page with the proper template). Is there a way to reference > these html files from the browser side? > http://site/app/test/templates/first.html does not work, for instance. > > Matt > >

