[Typo3] relPathPrefix not working?

Charles Rector crector at iexposure.com
Thu May 5 17:52:01 CEST 2005


This may sound like a silly problem, but I'm having a heck of a time 
getting relPathPrefix to work.

I'm using both the tx_automaketemplate and tx_rlmptmplselector 
extensions. Originally my relPathPrefix was set like so:

plugin.tx_automaketemplate_pi1 {
   ...
   relPathPrefix = fileadmin/subfolder/
}

However, I don't want all relative links to map there. I just want 
images and style sheets, etc. to point there. Currently, if I specify a 
link in a template such as <a href="53.0.html>link</a>, it gets mapped 
to fileadmin/subfolder/53.0.html. I first tried fixing it like so:

plugin.tx_automaketemplate_pi1 {
   ...
   relPathPrefix =
   relPathPrefix.img = fileadmin/subfolder/
}

All that did was remove both the style sheets AND images from pages. 
Then I tried:

plugin.tx_automaketemplate_pi1 {
   ...
   relPathPrefix =
   relPathPrefix.IMG = fileadmin/subfolder/
}

Since it seems both tx_automaketemplate and the actual TEMPLATE cObject 
have this attribute, and tx_automaketemplate seemed to want capitals. 
Still the same result.

Then I tried moving it into my TEMPLATE:

temp.mainTemplate = TEMPLATE
temp.mainTemplate {
   template =< plugin.tx_automaketemplate_pi1

   relPathPrefix =
   relPathPrefix.img = fileadmin/subfolder/

   ... subpart stuff ...
}

Now everything looks fine, but it's still pointing my links to 
fileadmin/subfolder, so I try:

   relPathPrefix =
   relPathPrefix.img = fileadmin/subfolder/
   relPathPrefix.a =

Same result. After much tweaking, if I did this:

   relPathPrefix = ./
   relPathPrefix.IMG = workdangit/
   relPathPrefix.A = youtoo/

I observed an odd behavior -- it maps all images to 
workdangit/fileadmin/subfolder/ and all links to 
youtoo/fileadmin/subfolder/... I'm not even specify 
fileadmin/subfolder/! Until I noticed this:

plugin.tx_rlmptmplselector_pi1 {
    templatePathMain = fileadmin/subfolder/
    defaultTemplateFileNameMain = index.html
    inheritMainTemplates = 1
}

This is the only place I can see where it might be getting the 
fileadmin/subfolder/... but if that's true, how do I make it play nice 
with relPathPrefix?

At this point I'm just very confused. Any ideas? :-)



More information about the TYPO3-english mailing list