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

Benjamin Mack benni at typo3.org
Fri Jun 5 19:35:38 CEST 2009


Hey Ernesto,

I gave your patch a first try. I like it.
Attached is a new patch that applies to latest trunk cleanly.

I agree with Franz that the way right now is still not flexible enough. 
Here are my thoughts:

* I tried to replace the link text (the filename by default, coming from 
cObj->filelink()) with the description so the description is linked to 
the download. This is currently not possible, but something needed very 
badly. Maybe we can have a register for the download link URL only as well.

* Some nitpicking. I was confused with the naming of "entryRendering", 
(entry = going in :)). Maybe we can find a naming that is consistent 
with other typical TypoScript paradigms... (I don't know a better one 
either, I like "itemRendering" but it's also not consistent :))

* Should we deprecate (or better: hide by default) the "colors", border, 
padding etc. options in TCEforms for the "uploads" CType? This does not 
make sense if you use TypoScript and don't use these values anymore.

I know that your patch brings the tableless approach, but maybe we can 
work on this patch to make it completely flexible so we don't need to 
touch the csc-uploads for a while after that :)

Thanks for your work, Ernesto.

All the best,
Benni.

On 15.05.2009 12:02 Uhr, Ernesto Baschny [cron IT] wrote:
> Hi Susanne,
>
> thanks for bringing this topic finally to the list and a patch. It was
> about time. :)
>
> While we were "typoscriptizing" this part, I would love to make it more
> flexible. Just having static "wraps" as a translation to the old
> table-based layout seems unflexible to me. This is why I yesterday
> implemented my idea for this:
>
> To allow custom rendering of each row. Meaning I have a cObject (e.g a
> COA) that has access to the current files properties through registers.
> And have that configuration go through splitOptions so that we can
> render each row differently (to get the "odd/even" effect).
>
> And this is how the original (backwards compabible) layout looks like in
> TypoScript:
>
> # 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.
>
> Cheers,
> Ernesto
>
> PS: I find that the split-up of typoscript in different full blown
> "versions" hadn't really reduced complexity. As you see in this patch, I
> need to include every change in all 4 files now. This will grow with
> future versions. Having a "common base" for new features (that are
> included also in all previous "templates") would be nicer.
>
>
> Susanne Moog schrieb:
>
>> This is an SVN patch request.
>>
>> Type: Feature
>>
>> BT Reference: http://bugs.typo3.org/view.php?id=2421
>>
>> Branch: trunk
>>
>> Problem:
>> The default uploads element from css styled content uses a hardcoded
>> table to generate the file list.
>>
>> Solution:
>> Extract the html table and make it configurable via TS.
>>
>> Notes:
>> The behavior should be the same as before. However you can test the
>> configuration with the following code, just to see some changes:
>>
>> tt_content.uploads.20 {
>> outerWrap = <ul>|</ul>
>> rowWrap = <li>|</li>
>> colWrap = <span class="csc-uploads-fileName">|</span>
>> fileNameWrap = |
>> fileSizeWrap = <span class="csc-uploads-fileSize">|</span>
>> iconWrap = <span class="csc-uploads-icon">|</span>
>> descriptionWrap = <p class="csc-uploads-description">|</p>
>> }
>>
>> If someone has a better idea to extract the html, please tell me. I'm
>> not sure if those wraps are the best way.
>>
>> Regards,
>>
>> Susanne
>>
>>
>



More information about the TYPO3-team-core mailing list