[TYPO3-core] RFC: Use split to fetch a value
Michael Stucki
michael at typo3.org
Mon Dec 12 21:41:29 CET 2005
Committed.
Michael Stucki wrote:
> Another CVS patch request:
>
> Problem:
> The "split" function works fine split a string and return something based
> on the splitted value. However it is not possible to simply return this
> value!
>
> Solution:
> Introduce a new property for the split function that returns the splitted
> value and returns it immediately.
>
>
> TSref changes:
>
> In section "split":
>
> cut Property:
> returnKey
>
> Data type:
> int / stdWrap
>
> Description:
> Instead of parsing the split result, just return this element of the index
> immediately.
> cut
>
> Example:
>
> Parse a custom tt_content field, split it line by line, and assign the
> current image element.
>
> tt_content.textpic.20.longdescURL.typolink {
> # Only return the URL, not the full <a href"..."> link
> returnLast url
>
> parameter {
> # This is a new db field where users can enter a
> # longdescURL one line per image
> field tx_myextension_longdesc
>
> split {
> # Split at newline
> token.char 10
>
> # This is the new property: Return the x-th
> # element
> returnKey.data register : IMAGE_NUM
> }
> }
> }
>
>
> If there is an existing way to get this value (I don't think so) please
> let me know...
>
> Michael
--
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/
More information about the TYPO3-team-core
mailing list