[TYPO3] templavoila: rewrite link path

Matyi Gábor gmatyi at freemail.hu
Fri Jun 13 11:09:54 CEST 2008


"Dmitry Dulepov [typo3]" <dmitry at typo3.org> írta: 

>Hi!

>Please, ask TV questions in TV list.

Ok.

>Because these paths are relative to CSS file. CSS specification says (http://www.w3.org/TR/REC-CSS1#url):
>"Partial URLs are interpreted relative to the source of the style sheet, not relative to the document"

It doesn't mention this situation, what I speak about. Of course if you include a css file in your html file, in this case the base of the url path is not the base document, but the css file.

>So, if your CSS file is in fileadmin/templates/1234, then images/image2.jpg is correct path.

yes, it is the path of the css file of the template. But the typo3 put some other css file in the base html file.
<link rel="stylesheet" type="text/css" href="typo3temp/stylesheet_8192c2092f.css" />
<link rel="stylesheet" type="text/css" href="typo3conf/ext/commerce/res/css/commerce.css" title="CSS-Style for Commerce Extension" media="all" />
<link href="fileadmin/templates/1234/style.css" type="text/css" rel="stylesheet" />
Where do you think the browser search the image2 in this case? 
typo3temp/images/image2.jpg
typo3conf/ext/commerce/res/css/images/image2.jpg fileadmin/templates/1234/images/image2.jpg 
 I think If you write the css code direct to the html files, in this case the base path is the base document, not any of the css file. 

Gabor


> Hi!
> 
> Please, ask TV questions in TV list.
> 
> Matyi Gábor wrote:
> > After I map this template with templatevoila, I experienced, that the 
> > link are rewritten in the result.
> > 
> > instead of <img src="images/image1.jpg"> I get <img 
> > src="fileadmin/templates/1234/images/image1.jpg"> it is normal.
> > 
> > but the css links are not rewritten. Of course the images/image3.jpg url 
> > path has to be the same, but the <td 
> > background-image:url(images/image2.jpg)> has to be rewrite to <td 
> > background-image:url(fileadmin/templates/1234/images/image2.jpg)> -this 
> > is my exprerience.
> 
> No, it's not ;)
> 
> > my question, why the templatevoila doesn't rewrite the url path, if it 
> > is en embedded css style code in a html file?
> 
> Because these paths are relative to CSS file. CSS specification says (http://www.w3.org/TR/REC-CSS1#url):
> "Partial URLs are interpreted relative to the source of the style sheet, not relative to the document"
> 
> So, if your CSS file is in fileadmin/templates/1234, then images/image2.jpg is correct path.
> 
> -- 
> Dmitry Dulepov
> E-mail: dmitry at typo3.org
> Skype: callto:liels_bugs
> TYPO3 technical: http://typo3bloke.net/
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
> 


More information about the TYPO3-english mailing list