[TYPO3-core] RFC #2421: Moving file uploads HTML from tx_cssstyledcontent_pi1 to TS

Ernesto Baschny [cron IT] ernst at cron-it.de
Fri May 15 16:21:15 CEST 2009


Franz Koch schrieb:

>> # Rendering for each file (e.g. rows of the table) as a cObject
>> entryRendering = COA
>> entryRendering {
>>     wrap = <tr class="tr-odd tr-first">|</tr> |*| <tr 
>> class="tr-even">|</tr> || <tr class="tr-odd">|</tr> |*|
>>
>>     10 = TEXT
>>     10.data = register:linkedIcon
>>     10.wrap = <td class="csc-uploads-icon">|</td>
>>     10.if.isPositive.field = layout
>>
>>     20 = COA
>>     20.wrap = <td class="csc-uploads-fileName">|</td>
>>     20.1 = TEXT
>>     20.1 {
>>         data = register:linkedFileName
>>         wrap = <p>|</p>
>>     }
>>     20.2 = TEXT
>>     20.2 {
>>         data = register:description
>>         wrap = <p class="csc-uploads-description">|</p>
>>         required = 1
>>     }
>>
>>     30 = TEXT
>>     30.if.isTrue.field = filelink_size
>>     30.data = register:fileSize
>>     30.wrap = <td class="csc-uploads-fileSize">|</td>
>>     30.bytes = 1
>>     30.bytes.labels = {$styles.content.uploads.filesizeBytesLabels}
>> }
>>
>> This will make it easy to have totally different layouts for rendering 
>> file uploads and not be so "table-centric".
>>
>> Attached patch solves it in this way.
> 
> although your way of doing it is better in my eyes, it's still lacking 
> some flexibility. And why is there still a hardcoded table in the code?
> 
> Why not rendering the beast completely in TS and let php only fetch the 
> files? If I find the time I'll give it a try and provide a patch.

The hardcoded table in the code is there for reasons of backwards 
compatibility. That has to come from PHP because it uses 
"getTableAttributes" which handles all table attributes configured 
through the tableParams_* settings.

The new way allows you to simply set an outerWrap, which will be the 
"last remaining" part that you can also now do in TypoScript (so that it 
can also be a <div> and not a <table> around the files).

So basically it is already the way you want it, just respecting (and not 
"reimplementing") old stuff for backwards compatibility reasons (think 
about someone upgrading his site with "old-school" TypoScript settings).

Cheers,
Ernesto


More information about the TYPO3-team-core mailing list