March 11th, 2004, 01:47 PM
Virtual Directories, includes, & getting correct paths???
I'm trying to have 1 folder for include files that can be called from other files on root, in subfolders below root, and in subfolders under other sub-level folders.
What approach should I take? Here's what I've tried:
First, Tried regular #include file=inc/filename, and that works, but then I need to make different versions of the same code for each folder level that will call the include files. (ie, 1 level below root gets "#include file=../inc/filename for the include and links & images have "../" before their path, too. It works but the multiple copies of the code is an issue for updating.
Second, tried virtual #include virtual=include/filename, and that works, created the virtual folder include to point to the actual inc folder, it gets the file ok, it displays it ok, but then the links & images are still relative to the the file that called them (some sub folder), not where the include file is at (inc in root).
What else can I try? It is possible, right?
Can't really use full path (http://www.blah.com/somefile.....) for include, links & images as this needs to move from test server to prod, etc, w/o changing contents of files.
I thought about base href, but a) that's in head tags only, and b) that'd set the whole page ....
March 11th, 2004, 02:36 PM
Try using include virtual from the top of your website
I've never been able to appreciate the sublime arrogance of folks who feel they were put on earth just to save other folks from themselves .." - Donald Hamilton
March 12th, 2004, 02:23 PM
Ok, got it!
Though our virual was on the root, and we did use /, it also needed a change in IIS, site properties, local path.
Otherwise we were so close, yet still not getting it. Now, all three pieces work together as they should.