Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
remap and use of common files (like css)
tobias
My branch/WA structure consists of a general workarea called "work" for admininstrators and specific WAs for different user groups.
Now, the .tpl templates in the WAs contain the following CSS reference:
<link rel="stylesheet" HREF="/css/corporate.css" TYPE="TEXT/CSS">
requiring each affected WA to contain the "corporate.css" style sheet in a folder "css".
To get rid of this redundancy I wanted to use TS's [iwproxy_...] configuration settings in
iw.cfg
to force the server to use the CSS from the general "work" WA. So I added the line
_regex=/css/(.*\.css)=/iw-mount/default/main/bochum/intranet/WORKAREA/work/css/$1
in iw.cfg's
[iwproxy_preconnect_remap]
section.
The regex does what it's supposed to do, but it unfortunately fires for all "/css/*.css" references on any WA on any branch.
Now I'm looking for a way to somehow limitate it's affect to my specific branch/WA.
Does anyone have an idea how to do so? Or is there another way of keeping my CSS files in only one place? (I'd like to tread other common files like scripts, icons the same, if possible.)
I can't use the absolute path for the CSS reference in the .tpl template because on the live web server the file structure is of course different from the structure on the TS server.
I'm using TS 5.5.2 on NT
Find more posts tagged with
Comments
tvaughan
Hey,
If I understand your question correctly, then there's nothing stopping you from changing your regex to start at "WORKAREA/work/css" instead of just "/css".
And, if you want to specify the branch, you can start your workarea at "
branch/subbranch
/WORKAREA/work/css"
So, you should be able to have a regex like this:
_regex=bochum/intranet/WORKAREA/([^/]+)/css/(.*\.css)=/iw-mount/default/main/bochum/intranet/WORKAREA/work/css/$2
That should map
any
workarea in the intranet branch to the work area for any css.
Is that what you want?
Tom
tobias
Hi Tom,
thanks for the response.
I tried your regex; unfortunately it doesn't work.
I think the problem is that the HTML template contains the relative path to the CSS: /css/corporate.css
So, the regex starting with "bochum/intranet/WORKAREA" doesn't match the string.
I can't use the absolute path for the CSS reference because on the live environment there is no "bochum/intranet/WORKAREA/..." path, of course.
If it was only for CSS files, the issue wasn't that important, as there is only a small number of them. An intelligent naming strategy would help here.
But I want to store frequently used icons on a single WORKAREA as well, and there's quite a few of them. So, introducing a regex for each icon or "blank.gif" in iw.cfg isn't really an option.
Tobias
intermec_sample.txt
Oldfont.zip
Migrateduser
You don't have to use a regex for each icon or each image, instead use a regex for the directory and then refer to it as /imagedirectoryname/iconname. Same goes for CSS.
What we do is this: have the common css file in home branch and use the following regex to access it from any branch as /css/whatever.css
_regex=^/iw-mount/default/main/([^/]+)/[^/]+/WORKAREA/[^/]+/css/(.*)$=/iw-mount/default/main/$1/home/WORKAREA/devwa/css/$2
Hope this helps.