Hi folks,

I have the following issue: my webapp is used as a kind of backoffice app
for various frontside websites. Each website has different basic layout,
both in templates as well as in the used static files. 

The integration is done with subdomains. Each frontside website has a
subdomain which points to my server.

www.frontside1.com -> front webside 1
shop.frontside1.com -> my app

www.frontside2.com -> front webside 2
shop.frontside.com -> my app

I have the need to serve different templates/statics based on the domain
name. To reduce complexity I would like to match the subdomains to various
directorys:

Requests from frontside1.com 
  Static files -> /public/frontside1/
  Templates    -> /templates/frontside1/
Requests from frontside2.com 
  Static files -> /public/frontside2/
  Templates    -> /templates/frontside2/

There are a sort of common templates used in /templates. Thus a "%include
../base.mak" or "%include base.mak" should also work inside mako.

What I already achieved is the domain based routing to static files -
generically. I'll post the final version of this to the Pylons website. In
short: I defined  "layoutpattern" who match to either the subdomain or the
domain part. The layoutpattern are managed inside a layoutpattern-manager,
who is used by a customized StaticURLParser class. The URLparser accepts the
request, asks the layoutpattern-manager about the correct layoutpattern and
uses this data to route the request to the correct directory. If no pattern
applies a default pattern is used.

The layoutpattern are usable for both templates as well as static files.

Now the "problem": after some source analysis I'm quite sure that I'll need
to implement a customized TemplateLookup-class for mako to handle the
layoutpattern. -> mako specific...

AND I need a way to initialize the mako template engine with this customized
lookup class. And here the integration into Pylons comes into play, meaning
buffet + the TGPlugin class.

I'm going to dig into the stuff, but any hints/ideas/docs/pointers are
highly welcome. Maybe I've overlooked a different interesting approach with
inhereting templates?

Regards,
Andrew





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to