[TYPO3-dev] Sorting and grouping of list - problem with rendering non-english characters
Erik Svendsen
erik at linnearad.no
Mon Jun 8 11:10:48 CEST 2009
Jigal van Hemert skrev:
> Hi Erik,
>
>> I'm working with an extension which are going to render a list in
>> frontend like this.
>>
>> A
>> A new day
>> About TypoScript
>>
>> E
>> Evalueting of CMS
>>
>> ans so on. Every title, text are linking to more information
>
> This could be done with Typoscript, unless you need a paginator in the list.
> But if you want to write an extension for it, fine with me :-)
>
I know, but I try to make it more universal, so I can fill out the table
and field in which are going to be fetched in the flexform. And a
paginator is probably necessary.
>> I fetch the list as an array ( and using
>>
>> $firstletter = row[field][0];
>>
>> to fetch the first letter of the sentence/title and place it in a
>> marker.
> Here you use the string as an array, which will give you only the first
> byte and not (always) the first character! In encodings such as utf-8,
> etc. some characters can use more than one byte (utf-8 currently 1-4 bytes
> per character)
>
> t3lib_cs::crop() or t3lib_cs::substr() seem more appropriate to me as they
> are multi-byte safe.
Thanks, I'm going to to check it out.
> In general: try to use TYPO3 API functions whenever possible. They are
> adapted to TYPO3 specifics or they can be extended in some way.
> I also hope that you build your links with one of the many typolink()-like
> functions; that way you will be compatible with realurl, cooluri, etc.
>
I do!
> Regards,
Erik
More information about the TYPO3-dev
mailing list