[TYPO3-core] RFC: #10359: Empty subparts are ignored

Jigal van Hemert jigal at xs4all.nl
Sat Aug 15 21:45:59 CEST 2009


Hi Steffen,

Steffen Ritter wrote:
> Sorry, but I think this makes no sense...
> Evaluating empty subpart to false is the correct behaviour, since it 
> means "nothing to do".

It means either "subpart markers not found" or "subpart is empty". It 
can't judge what the calling code may or may not do with the information.

> Why should an emppty subpart rise processing which never will get used?
> So it is an performance degree, instead of an improvement.

That's a good point!

> And if for automaketemplate considers <div id="iamempty"></div> as an 
> subpart, i think this is the wrong behaviour or, the user wants to use 
> it wrong. To me the sense is to mark some parts in an (complete) 
> html-template as "typoscriptable" by wrapping it. If I have an empty 
> div, not wrapping anything, this is nothing to replace but some design 
> helper.

Tell this to the numerous users who spend time puzzling why their 
template doesn't work:
- I made a simple template to test some Typoscript but it doesn't work
* Let's see: did you set a class or id for the elements you want to use?
- Yes. <div id="menu"> etc.
* Did you put something inside the div? It may not be empty.
- Huh?? Okay, I put something in the div's. Now I can see the content, 
but the menu is stil broken.
* Did you put '0' (zero) in that div? You may not put a zero in the div.
- Huh???? Why (...)? Okay, thanks now it works. (...)

(I left out the cursing and replaced it with (...) )

I'm going to change it that getSubPart() returns FALSE if the markers 
are not found. I searched the trunk and only found cases where the 
returned value was evaluated as a whole and never compared to an empty 
string. So returning FALSE will not break any core code.

-- 
Jigal van Hemert.


More information about the TYPO3-team-core mailing list