Le Fri, 17 Jun 2011 21:59:47 +0530, Joshua Immanuel <[email protected]> a écrit :
> On Fri, 2011-06-17 at 16:47 +0200, Thierry Florac wrote: > > Sorry but I'm not really sure to understand what you want or need... > > > > The physical path of your folder inside your ZODB is > > '/site1/container1/...' and to access such a site you only have two > > ways to do it : > > - address it directly in the URL > > - or use virtual hosting to hide '/site1' from the URL > > Ok, let me give an use-case. Say, I have a base page layout template > for the inner sites like "http://localhost:xxxx/site1" which has many > application related menu links on the top and left hand side of the > page with center space for contents. All these links are of the format > "/container1/...". When I use virtual hosting to '/site1' I have no > problem, all the links will be a valid one, as it will be prefixed by > "http://localhost:xxxx/site1" > > But, If I don't use virtual hosting and I expose > "http://localhost:xxxx/" URL to the user to create new sites. The > links in base page layout template for the inner sites will be an > invalid one as it will be pointing to > "http://localhost:xxxx/container1/.." instead of > "http://localhost:xxxx/site1/container1/.." > > I am trying to figure out how to prefix the links in the base page > layout template with site names based on which site they belong. So > that the links in the base page layout template of 'site1' would be > of the format '/site1/container1/.." and the links in base page > layout template of 'site2' would be of the format > '/site2/container1/.." etc. > > I guess the solution to this (without virtual hosting) would be: when > I render the base page layout template for > "http://localhost:xxxx/site1" get the 'site1' part from the request > URL and prefix all the related menu links with them. Is there any > other better solution? > > But, If I use this base page layout template as a macro (just to fill > its center content with an add form say) still the menu links has to > be a valid one. How to handle this? > > Hope I clarified what I need. Please excuse me if my question sounds > too novice. I suppose that you could write your own IAbsoluteURL adapter ;-) Alternatively, for a given context, you can probably try to find it's parent site (« site1 », via "getParents()" traversing method), get it's URL and concatenate it with your actual "absolute" URLs... Regards, Thierry -- Chef de projets internet/intranet Office National des Forêts Département Informatique 2, Avenue de Saint Mandé 75570 PARIS Cedex 12 Tél. : 01 40 19 59 64 Fax. : 01 40 19 59 85 Mél. : [email protected] WWW : http://www.onf.fr _______________________________________________ bluebream mailing list [email protected] https://mail.zope.org/mailman/listinfo/bluebream
