From: Alex B. <en...@tu...> - 2001-09-14 18:04:34
|
> The following problem occurs: > > I have a master template that is used in bcp defs in different levels e.g.: > > www.foo.com/en/manage/news/ > www.foo.com/en/manage/users/newsletters/ > .. > > The scripts and the master template there uses resources from our > build/en/htdocs/resources directory. One way to accomplish a correct loading > of the resources is to use absolute paths in the tags i.e. > src=/en/resources/whatever/file.gif. But what if we want run the scripts a > level deeper i.e. in www.foo.com/r2/en/manage/news. Problem. > > The way I sove this currently is running a symlink to > build/en/htdocs/resources in every htdocs subdir and using relative paths in > the templates i.e src=resources/whatever/file.gif. > > It works and it's smooth on unix systems but I feel thats a very error prone > way. Especially while running on win systems where symlinks are not possible > (and creating virtual dirs all over the build tree is a mess). > > Any ideas, plans how to handle this? > > I guess that's a good application for ImageRequestBuilder. well, only sort of. The ImageRequestManager is intended to solve all of those problems along with the CSS and JS request managers, by removing any need to define absolute paths in src attributes. You'd set a 'resources location' path constant in Configuration, and ImageRequest would use that during make to properly reference (with an absolute path) all of that stuff. _a |