[TYPO3-english] css_styled_content -> different behaviour depending on include techique
Christian Ruppert
christianruppert at gmx.net
Sun Apr 12 15:07:25 CEST 2009
Hi,
I am doing spring-cleaning in my typo3 installations, and discovered a
very strange behaviour.
As you (hopefully) all know, there are two ways to include static
templates in typo3.
I will use a simple extensions as example:
0) Install extension
A) Include basic extension templates in root template with INCLUDES --
Include static (listbox)
B) The manual way, which is a import command used in typoscript.
I prefer the manual way, I always copy the basic setup and constants
template of an extension to a dedicated folder, include them with a line
similar to these two in my stylesheet:
<INCLUDE_TYPOSCRIPT: source="FILE:
fileadmin/typoscript_ext/air_filemanger/030_minimal_root_setup.ts">
Now this works perfectly for nearly everything. I have a cascaded
structure, all things work fine, except:
CSS_STYLED_CONTENT...
It behaves different when importing it via listbox or via typoscript
command. How can this be? And its not that it is not working, it is
working "half way". Meaning, if I miss the constants inclusion, the
headlines are not formatted correctly. If I include setup and constants,
then normal content looks ok (simple text element with heading), but
"plugins" and other special elements are not rendered. Like a simple
menu or sitemap.
If you want to try to reproduce the error, or understand what I mean, do
the following. Create a simple site, with a even more simpler template.
Setup of the template is just:
Put this in a file named setup
-------------------------------------------------------------
page = PAGE
page {
typeNum = 0
admPanelStyles = 1
config {
stat_mysql = 1
sys_language_uid = 0
language = en
locale_all = en_EN
cache = 1
no_cache = 0
doctype = xhtml_trans
xhtml_cleaning = all
index_enable = 1
metaCharset = utf-8
additionalHeaders = Content-Type:text/html;charset=utf-8
}
}
page.50 = HTML
page.50.value = testsite
page.100 = COA
page.100 < styles.content.get
page.100.select.where = colPos = 0
------------------------------------------------------------
Create a new template and include the file above in the setup field
<INCLUDE_TYPOSCRIPT: source="FILE: fileadmin/root_setup.ts">
Now include the css_styled content in the listbox of this new template.
Look at your page, create a text box and a login-box. Everything works
nice!!!
NOW, remove the css_styled_content from the template, and include it via
import line:
<INCLUDE_TYPOSCRIPT: source="FILE: fileadmin/css_styled_content_setup.ts">
<INCLUDE_TYPOSCRIPT: source="FILE:
fileadmin/css_styled_content_constants.ts">
(Seperately, in setup and constants, of course - no newbie errors here)
NOW, take a look at your site: The text elements still look nice, but
the sophisticated elements are gone.
This must be because of some kind of "order" in how typo3 parses all
this stuff, but I wasn't able to figure out what the problem might be.
If anyone has any ideas, please enlighten me. I am particually worried,
because I include all extensions this way (via static lines inside
external configuration files). My database template is basically only an
import of two files setup.ts and constants.ts, and all the work is done
there. Except the css_styled_content... So if there is any "problem"
with this way, I am eager to know..
Christian
PS: And for everybody who read to this point and is new to the topic,
some little candy beside:
Always include these two options in your user tsconfig. Then you can
edit your ts files with a pretty nice editor (like sweets) and just
press refresh in your browser.. Works like a charm:
admPanel.override.tsdebug.forceTemplateParsing = 1
options.alertPopups = 252
Oh, and if you want to, include these lines in your typo3 core (fixes on
your own risk)
\t3lib\class.t3lib_tsparser.php
Line 530
if (@is_file($filename) && filesize($filename)<100000) { // Max.
100 KB include files!
// check for includes in included text
$included_text =
self::checkIncludeLines(t3lib_div::getUrl($filename),$cycle_counter+1);
$newString.= $included_text.chr(10);
}
else
{
// ruppertchristian featureimplement
die("Typoscript file not found " . $filename);
}
More information about the TYPO3-english
mailing list