[TYPO3-core] RFC: Extend TypoScript values

Michael Stucki michael at typo3.org
Mon Feb 13 23:57:36 CET 2006


Hi René,

>> What about using properties like I already did but wrap them in
>> underlines?
>>
>> xyz.pidList._addToList_ = 20,21
> 
> I'm still not shure about that. People are already confused about
> TypoScript.

I don't think this is confusing if we describe it good enough. Here is a
suggestion for TSref (other documents may need to be changed, too):

--- cut ---
Title:
Superglobal directives

Keys:
_addToList_
_addString_
_removeFromList_
_removeString_
_[custom directive defined by an extension]_

Description:
TYPO3 offers some powerful preprocessor methods for modifying Typoscript
properties _before_ they are passed to the parser. Superglobal directives
can be applied to any Typoscript property but have a very limited
functionality.

Whenever a superglobal directive is found, the value is immediately applied
to the parent Typoscript property and then deleted. For example, the object
browser does not display superglobal directives but the changed property
instead.

It is possible to mix multiple superglobal directives and/or use them
repeatedly.

Example:
lib.myList = 4,5,6
lib.myList._addToList_ = 7,8

This will change the value of lib.myList to 4,5,6,7,8
Additionally, lib.myList._addToList_ will be removed from the parsed
configuration and is therefore not existing anymore.
--- cut ---

> It's an preprocessor functionality but why should anyone care about that?
> For the TypoScript developer it makes no difference, does it?

Compare it with PHPs superglobal variables. They look very similar to normal
variables, but they are existing in every single function. What's wrong
with that?

> Anyway. Another suggestion:
> 
> xyz.pidList.proc_addToList = 20,21
> or better
> xyz.pidList.proc.addToList = 20,21

Bad because "proc" is used at some other places already. I think we should
introduce a new pattern which highlights itself as something special.

> this identifies the function clearly as a preprocessor function but it
> still can be used easily for all TS dev's because it works the same way.
> 
> The only thing is that we have an reserved word now: "proc" with the
> second option.

I think there is another problem: It is hard to realize this keyword beause
of wrapped/indented code:

lib.myList = 20
lib.myList {
  proc {
    addToList = 21
  }
}


Attached is an updated patch which uses the suggested _[keyword]_ pattern.

Regards, michael
-- 
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: changeProperties_v2.diff
Type: text/x-diff
Size: 3245 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060213/c3ad4ca2/attachment.bin 


More information about the TYPO3-team-core mailing list