Bug #20471
closedTEMPLATE directive doesn't generate any output
0%
Description
I have a problem with some very basic TS Code, where I cannot identify the reason of my problems.
In the meantime, I have reduced all code to an outmost simple version (see below).
The outcome is always the same:
The TEXT directive (same applies for HTML directive and others) is processed and generates an output, the TEMPLATE directive is ignored. Files are valid, paths are correct, I have no idea where to look for any errors.
Fact is: in the code below page.5 is ignored (TEMPLATE), page.20 (TEXT) is rendered.
Any advice how to analyze what happens with the TEMPLATE
TSCode:
//////////////////////////////////////////////////////////////////////////////////////////////////////
- Template content object:
temp.mainTemplate = TEMPLATE
temp.mainTemplate {
template = FILE
template.file = fileadmin/html/htmlTest.html
}
- Default PAGE object:
page = PAGE
page.5 < temp.mainTemplate
page.20 = TEXT
page.20.value = TEST
//////////////////////////////////////////////////////////////////////////////////////////////////////
Content of testHTML.html (path is, of course, correct)
<html>
<head></head>
<body><h1>This is a test!</h1></body>
</html>
//////////////////////////////////////////////////////////////////////////////////////////////////////
Output produced by Typo3 (same with 4.2.6 or 4.1.10)
<!DOCTYPE html
PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="typo3temp/stylesheet_8192c2092f.css" />
<title>Home</title>
<meta name="generator" content="TYPO3 4.2 CMS" />
<script type="text/javascript" src="typo3temp/javascript_93077bb238.js"></script>
</head>
<body>
TEST
</body>
</html>
=> page.20 is executed, page.5 is missing !!!
(issue imported from #M11143)
Updated by Christian Müller over 15 years ago
You wrote:
----
template.file = fileadmin/html/htmlTest.html
...
Content of testHTML.html (path is, of course, correct)
----
Naming Error for template file? Try lowercase and make sure the filename is an exact match.
Updated by Juergen Kreis over 15 years ago
I have done some tests by adding some debug output.
The problem seems to be within the file
class.t3lib_tstemplate.php
When TS3 tries to resolve the TEMPLATE directive, it forwards the pathInformation to getFileName().
In that function $this->getFileName_backPath should point to the absolute path in order to make the line
if (@is_file($this->getFileName_backPath.$file))
working.
Now, $this->getFileName_backPath is an empty string, hence the if section won't execute ...
It seems to me, as if this->getFileName_backPath never is initialized ...
Updated by Juergen Kreis over 15 years ago
Hi Christian,
thanks for the reply.
No, the file is correct - I made a typo when I wrote the bug report.
Both, the name in the script, and the file name itself, do match (htmlTest.html).
There is also no change, if name and script are changed to test.html to avoid capitals ...
So, the problem, as stated before, seems to be within the non-initializeed backPath variable.
Updated by Christian Müller over 15 years ago
Which version do you use? I will setup the same here and try it out.
Updated by Juergen Kreis over 15 years ago
I am currently using 4.2.6
What is strange, too, is that the is_file function seems to return TRUE only for files, that are located under the typo3/ directory while for all other paths typo3conf/..., fileadmin/... this function returns FALSE even though the files do physically exist.
Is there a chance, that Typo3 has some access rights issue in here ?
PHP Version 5.2.4-2ubuntu5.5
Server API CGI/FastCGI
Safe_mode off
Kind regards
Juergen
Updated by Juergen Kreis over 15 years ago
Thinking about this , could there be an issue with the Symlinks ?
Typo3_src is located outside of the www-Path
All typo directories (t3lib, typo3, index.php) are symlinked from there ....
(I followed the install instructions to enable easier upgrading by only changing the symlink for typo3_src )
Updated by Christian Müller over 15 years ago
Seems to be a problem with symlinks. Check this:
http://typo3.toaster-schwerin.de/typo3_english/2009_05/msg00323.html
Even if you do not use lighttp try to copy the index.php over.
Updated by Juergen Kreis over 15 years ago
Excellent, this really solved the problem!
Thanks again for all your efforts.
Might be recommendable to have a remark in the installation tutorial ...
Kind regards
Juergen