[TYPO3-v4] File Links/CType uploads

Lorenz Ulrich lorenz-typo3 at visol.ch
Wed Jun 8 02:38:02 CEST 2011


Hi everyone

As announced before, I would like to improve the File Links (CType 
uploads) for TYPO3 4.6. Main goal would be to have the filelinks CSS 
stlyable without the use of a 3rd party extension (css_filelinks namely).

As this CType has quite a history, I would like to present the current 
state and my proposals before starting to work. This way I hope we can 
agree on how to improve it and don't need 100 patch sets until everyone 
is ok with it...

:-)

The out-of-the-box behaviour of file links is:

- You can choose files from the TYPO3 media browser or
- indicate a path to a folder containing files (no wizard there, you 
need to insert the relative path manually)

If you don't change a setting, you will get a list of all the files in a 
table, one table cell per file (configurable by Typoscript).

If you enable the display of the file size information, you will get 
another column with the file size.

If you choose any other layout than Default (0), you will get 
(old-fashioned) file type icons. The path to the icons is hardcoded to 
"typo3/sysext/cms/tslib/media/fileicons/".

If you choose layouts 2 or 3 and you have a file in the list of a type 
that TYPO3 recognises as an image 
([GFX][imagefile_ext]=gif,jpg,jpeg,tif,tiff,bmp,pcx,tga,png,pdf,ai), a 
thumbnail image (150 pixels default width, configurable by Typoscript) 
is shown instead of an icon.


css_filelinks uses definition lists (<dl>) instead of a table to render 
the links. Standard rendering would be

<dl>
	<dt>[Link to file 1]</dt>
	<dt>[Link to file 2]</dt>
</dl>

And when using descriptions:

<dl>
	<dt>[Link to file 1]</dt>
	<dd>[Description of file 1]</dd>
	<dt>[Link to file 2]</dt>
	<dd>[Description of file 2]</dd>
</dl>


I like this approach but the problem is that it won't validate as HTML5 
as in HTML5 a <dl> needs at least one <dd> while we can't guarantee that 
at least one description is given (we could insert an empty dd if no 
description is set but that would not be beautiful).


This leads to my questions:

- Should we stick to the current implementation with tables or does 
anyone have a better idea?

- Is it OK to have that thumbnail behaviour for Layouts 2 and 3 that's 
only reflected in the source code?

- How could the path to the icons be made configurable. Having a setting 
to change the path would be the beginning, but as file type ".gif" would 
still be hardcoded. Maybe two configurations iconPath and iconType?

- Can we drop the deprecated table attribute stuff 
tt_content.uploads.20.tableParams_* (cellpadding, cellspacing, border) 
and the color configuration for even and odd?

- Any other thoughts and ideas?


Thanks for answering and best regards,


Lorenz


More information about the TYPO3-project-v4 mailing list