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

Susanne Moog typo3 at susannemoog.de
Sun Jun 21 20:32:58 CEST 2009


Hi,

+1 by testing to v4.


Best regards,

Susanne



Ernesto Baschny [cron IT] schrieb:
> Benjamin Mack wrote: on 05.06.2009 19:35:
> 
>> 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.
> 
> Attached patch gives this new possibility. That would be the needed setup:
> 
> tt_content.uploads.20.labelStdWrap.override.data = register:description
> 
> With "labelStdWrap" you can also load other information from the file
> into the "linked text" (e.g. combining description, filename, filesize,
> etc).
> 
>> * 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 :))
> 
> Changed to itemRendering.
> 
>> * 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.
> 
> Yes we could. But not with this patch/RFC. :)
> 
>> 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 :)
> 
> Yes, that is the idea. I think it is at this state now. What do you think?
> 
> Since the patch (-v4) changed a bit, I would love to see another two +1
> again.
> 
> 
> Pending documentation for css_styled_content part that I would add will be:
> 
> 
> For "render_uploads" userFunc, added properties:
> 
> 1) itemRendering, cObject/+optionSplit. Provides the rendering
> information for every row in the file list. Each file will be rendered
> with this cObject, optionSplit will be applied to the whole
> itemRendering array so that different rendering needs can be applied to
> indidivual rows. Default rendering is a COA for table based rendering
> with even/odd classes in the rows. Available registers at this point are:
> - linkedIcon: a linked icon representing the file (either
> extension-dependent or a thumbnail of the image)
> - linkedLabel: the linked text, usually the filename. The text can be
> overwritten using the labelStdWrap property.
> - filename: the filename being rendered (with extension, but without path)
> - path: the full path of the file
> - description: optional, if available
> - fileSize: the size of the file in bytes
> - fileExtension: the extension of the file (e.g. "pdf", "gif", etc)
> 
> Example:
> 
> 	itemRendering = COA
> 	itemRendering {
> 		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:linkedLabel
> 			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}
> 	}
> 
> 
> 2) labelStdWrap, stdWrap. Provides a mean to override the default text
> that is linked in the "linkedLabel" registry for each itemRendering.
> Registry items filename, path, description, fileSize and fileExtension
> are available at this point.
> 
> Example:
> 
> tt_content.uploads.20.labelStdWrap.override.data = register:description
> 
> 
> Cheers,
> Ernesto
> 


-- 
Susanne Moog
NEUSTA GmbH - www.neusta.de


More information about the TYPO3-team-core mailing list