[TYPO3-dev] Path problem with $TBE_STYLES['htmlTemplates']['templates/db_layout.html']

Steffen Kamper info at sk-typo3.de
Fri Jul 25 23:52:52 CEST 2008


Tapio Markula schrieb:
> Tapio Markula
>> Hi
>>
>> Setting $TBE_STYLES['htmlTemplates']['templates/db_layout.html']
>> in a skin plugin has a path problem.
>>
>> Path is normally
>>
>>     $templatedir='../'.$temp_eP.'htmlTemplates/';
>>
>> where $temp_eP = t3lib_extMgm::extRelPath('skin_grey_2');
>>
>> BUT this doesn't work if Typo3 has been installed into a subdirectory
>>
>> A hack might solve that
>>
>>
>> $templatedir='../'.$temp_eP.'htmlTemplates/';
>>     if(!is_dir(PATH_site .substr($templatedir,6))) // if installed 
>> into subdirectory must add '../'
>>         $templatedir='../../'.$temp_eP.'htmlTemplates/';
>>     if(is_dir(PATH_site .substr($templatedir,6))) { // directory might 
>> not be found if Typo3 has been installed into a subdirectory
>>      
>> $TBE_STYLES['htmlTemplates']['templates/db_layout.html']=$templatedir.'db_layout.html'; 
>>
>>    
>> But is there a better solution
> 
> this is really nasty -  $TBE_STYLES['htmlTemplates'] has problems always 
> when Typo3 is not installed into main domain - all subdomain 
> installations fails.

I can't believe that this fails because it's relativ. Absolute paths 
will fail definitively.

$templatedir='../'.$temp_eP.'htmlTemplates/';

will result in something like

../../typo3conf/ext/skinext/templates

where is influence of subdir?

vg Steffen




More information about the TYPO3-dev mailing list