>
> I made an table called site that contains domainname and domain_url and by
> matching domainname and request.env.host_name I get an domain_url from
> database.
> In every .html I have changed the {{extend "layout.html"}} to {{extend
> domain_url + "layout.html"}}
>
This approach may be somewhat inefficient because it involves a database
lookup on every request (this could be mitigated by storing the paths in a
dict rather than the db, assuming there aren't a large number of domains),
and having a variable in the {{extend}} directive will prevent you from
compiling the views (compiled views can be quite a bit faster).
Also, minor nit, but views/domain1/layout.html is not a URL but a
filesystem path (so maybe call it domain_path or domain_view_path).
If there aren't many domains, another approach might be to create multiple
copies of the app, each with different views.
Anthony
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.