fileList{field=media
path=uploads/media/
path.override.field=select_key
path.override.listNum=first
path.override.listNum.splitChar=|
override.filelist.field=select_key
}
This typoscript say where the filenames are stored and which path to use. This is by default added and you don't need to change it if you use the default media database field.
description.field=imagecaption
description_ifElementEmpty=###FILENAME###
description and description_ifElementEmpty have stdWrap properties.
description | |
|---|---|
description | Here the description for files should be stored. You can use stdWrap properties e.g. description.field, description.ifEmpty.field description.value(...) ... Default is this set to description.field=imagecaption |
description_ifElementEmpty | Define what should be used for description if the description for an element is empty. E.g. we have this settings: description.field=imagecaption description_ifElementEmpty=###FILENAME### And this description: “Description 1 Description2 Description4” the 3-rd element has no description and the ###FILENAME### placeholder will be used. (If you install the dam usage for filelist, you can define which field should be used if the description is empty by this setting: dam.damDescription=field ) |
additionalClass{image=bmp,gif,ico,jpg,png,tiff
video=wmv,avi,asf,mpg
audio=mp3,wav,mid
}
This class replace the marker ###ADDITIONALCLASS###(see the layout section). So you can define an additional class depending on file extension. The syntax is simply:
additionalClass.classname=fileextensions separed by ','
EXAMPLE:
additionalClass.image=bmp,ico
additionalClass.stuff=bmp
filename | Additional class |
|---|---|
image.bmp | image stuff |
image.ico | image |
document.doc |
Classes{addFirst=1
addLast=1
addOdd=1
addEven=1
ext.prefixIfFirstNumber=
}
The values first,last,even and odd will replace the marker ###FIRSTLASTODDEVEN###(see the layout section).
Classes | |
|---|---|
classes.addFirst | If the class “first” should be added to the first element. |
classes.addLast | If the class “last” should be added to the last element |
classes.addOdd | If the class “odd” should be added to every odd element. |
classes.addEven | If the class “even” should be added to every even element. |
classes.ext.prefixIfFirstNumber | If the file extension start with a number e.g. *.3df. Then by ###FILEEXT### and ###CLASS### the inserted value will not be a right class definition because the class cannot start with a number. Here you can define a string that will be added to the beginning of the file extension if the file extension starts with a number. E.g. if you set this: classes.ext.prefixIfFirstNumber=num and the file extension is 3ds the value inserted into ###FILEEXT### and ###CLASS### will be num3ds if you set this to blank then only the file extension without prefix will be inserted. |
layout{global=<div class="l###LAYOUT###"><span class="filecount">###FILECOUNT###</span>###FILE###</div>
file=<a href="###URL###" class="###CLASS###" ###TARGET###>###COUNTER###) ###TITLE### ###FILESIZE###</a>
fileSize{layout=(###SIZE### ###SIZEFORMAT###)
char=none
format=auto
desc=b|kb|mb
round=2
}
}
layout | |
|---|---|
layout.global | the layout of the whole extension |
layout.file | the layout of one file |
layout.fileSize.layout | layout of the ###FILESIZE### placeholder |
layout.fileSize.char | Say if the characters by ###SIZEFORMAT### should by converted to uppercase or lowercase. Possible options are "upper","lower","firstUpper","firstLower","none". If you enter none you become the original ###SIZEFORMAT### without lower-uppercase conversion. |
layout.fileSize.format | Which format should the size have. Posible values are b-bite, kb-kilobite, mb-megabite, auto. |
layout.fileSize.round | Set number of digits after the decimal point. |
layout.fileSize.desc | You cann set the description for b,kb and mb the syntax is layout.fileSize.desc=bitedesc| kilobitedesc | megabitedesc EXAMPLE by layout.fileSize.desc=kbite|mbite|mgbite you will become such values 12.01 kbite or 10.00 mbite etc. |
layout.hideNotProcessedMarkers | If this is set to 1 then all not processed placeholders are deleted. E.g. If you set a placeholder ###test### and you don't use this placeholder, with this setting this placeholder don't appear on the frontend. |
stdWrap properties
layout.global, layout.file and layout.fileSize.layout have stdWrap properties so you can use e.g. this code:
tt_content.uploads.20.layout.file >
tt_content.uploads.20.layout.file.cObject=COA
tt_content.uploads.20.layout.file.cObject{wrap=<div class="###CLASS###">|</div>
10 = TEXT
10.wrap=<span>|</span>
10.value=<a href="###URL###">###TITLE###</a>
20 <.10
20.value=###FILESIZE###
30 < .20
30.value=###DESCRIPTION###
}
Placeholders
for layout.global only | |
|---|---|
###FILE### | where the files should be putt |
for layout.file only | |
###URL### | Insert file url. |
###CLASS### | This placeholder includes ###FILEEXT### ###ADDITIONALCLASS### ###FIRSTLASTODDEVEN###. |
###TARGET### | Insert linkProc.target property |
###FILEEXT### | Insert File extension. This placeholder can be used in class e.g. |
###ADDITIONALCLASS### | Insert additional class (see the Additional Class section) |
###FIRSTLASTODDEVEN### | Insert the class values first, last, even and odd. (see the classes section) |
###COUNTER### | Insert A simple counter, the first file have counter=1 |
###ICON### | Insert a image with icon or thumbnail in dependence on linkProc.iconCObject settings. If you set linkProc.iconCObject.makeThumbs=1 then this extension will create thumbnails for images instead from icons. |
###TITLE### | Insert file name (if you install the dam usage for filelist, you can define which field should by used as title) if you select linkproc.removePrependedNumbers=1 you will become instead from e.g. “filename_01.jpg” this “filename.jpg” |
###FILENAME### | Insert file name. Ignore the linkproc.removePrependedNumbers property and dam usage. |
###DESCRIPTION### | Insert description from description field from backend. If you use dam, you can define a tx_dam field from which the description for each file should be taken. For more info see the Manual to “Filelink DAM usage” extension. |
###FILESIZE### | Insert the layout.fileSize element if show filesizes in filelinks backend is allowed. This placeholder is made to supply the show filesizes functionality. If you dont need this functionality you cann set the: ...file=.... ###TITLE### (###SIZE### ###SIZEFORMAT###)... instead off ...file=.... ###TITLE### ###FILESIZE###... this will work too.
|
###SIZE### | Insert file size. |
###SIZEFORMAT### | Insert filesize format (see layout.fileSize.format). |
for both | |
###FILECOUNT### | Insert file count. |
###LAYOUT#### | Insert the value from layout field from filelinks backend.
|
User defined placeholders
layout{userMarker{global{MARKER1=TEXT
MARKER1.value=test
}
file{ICON2 = USER
ICON2.userFunc=tx_cssfilelinks->Icons
}
dam{FILECREATE=date_cr,date_mod
AUTOR=autor
}
}
}
There are 3 types of user defined placeholders:
global
file
dam
The first 2 have this SYNTAX:
layout.userMarker.global.USRMARKER=USER
layout.userMarker.global.USRMARKER.userFunc=someClass->someFunction
this marker can be than used this way
layout.global=<div class="###LAYOUT###">###USRMARKER###
File markers have the same syntax.
DAM userMarker:
The last one (the dam) has this SYNTAX:
layout.userMarker.dam.USRMARKER = tx_dam table field names separed by ','
To use this last marker you need to install Filelinks DAM usage (dam_filelinks). If you add more then one field - the last not empty field will be chosen.
Warning: The markers are case sensitive.
This extension add some data to the userMarker.global and userMarker.file typoscript before this typoscript will be processed.
For global marker | |
|---|---|
markerData.fileCount | file count |
markerData.fileLayout | the layout field from filelinks backend |
For file marker | |
markerData.fileUrl | file url |
markerData.fileName | file name |
markerData.fileTitle | file title |
markerData.fileSize | file size |
markerData.fileExt | file extension |
markerData.dam | If this file was obtained from dam database using the “Dam filelinks usage” extension the markerData.dam will contain the ID from this file, otherwise it will be null. |
markerData.fileCount | file count |
markerData.fileLayout | the layout field from filelinks backend |
so if you use this code:
layout.userMarker{file.ICON = USER
file.ICON.userFunc=myClass->Icons
}
it changes to
layout.userMarker{file.ICON = USER
file.ICON.userFunc=myClass->Icons
file.ICON.markerData{fileUrl=...
fileName=...
fileTitle=...
fileSize=...
fileExt=...
dam=...
fileCount=...
fileLayout=...
}
}
and so you can use the markerData in your own scripts
EXAMPLE:
For userMarker.file( userMarker.global has the same syntax).
If you want create your own function for icon creating you can make it follows:
layout{file=<a href="###URL###" class="###CLASS###">###ICON2### ###TITLE### ###FILESIZE###</a>
userMarker{file.ICON2 = USER
file.ICON2.userFunc=myClass->Icons
}
}
and the function can be:
function Icons($content,$conf){return '<img src="typo3/gfx/fileicons/'.$conf['markerData.']['fileExt'].'.gif" alt="'.$conf['markerData.']['fileTitle'].'" />';
}
For userMarker.dam:
If you will use this marker you muss install the “Filelist DAM usage(dam_filelist)”. You can show e.g. Autor from that file with this code:
layout{file=<a href="###URL###" class="###CLASS###">###AUTOR### ###TITLE### ###FILESIZE###</a>
userMarker.dam.AUTOR=autor
}
where autor is a field in tx_dam table.
linkProc {target = _blank
jumpurl = {$styles.content.uploads.jumpurl} jumpurl.secure = {$styles.content.uploads.jumpurl_secure}removePrependedNumbers = 1
alternativeIconPath=fileadmin/icons/
iconCObject = IMAGE
iconCObject.makeThumbs=0
iconCObject.file.import.data = register : ICON_REL_PATH
iconCObject.file.width = 150
}
linkProc | |
|---|---|
target | Target value for links. If you let this blank the target will not be inserted |
jumpurl | If you set this to 1 the links will not be “upload/file.jpg” but some like “http://www.site.com/index.php?id=1&type=0&jumpurl=uploads%2Ffile”.jpg” and you can secure the “upload” directory e.g. width _htaccess. |
jumpurl.secure | If you set this to 1 the links will be like “http://lwww.site.com/index.php?id=1&type=0&jumpurl=uploads%2Ffile.jpg&juSecure=1&locationData=9%3Att_content%3A44&juHash=2469f79328” which is more secure like only with jumpurl setting. |
alternativeIconPath | Standard the path where this extension search for icons is 't3lib/gfx/fileicons/'. If you enter an path here then this extension will search for icons in this path. If no matching icon is found it checks for default.gif, if this is not found it search in old path(t3lib/gfx/fileicons/'). |
removePrependedNumbers | If you set this to 1 then if you have file like file_01.jpg the title will be not file_01.jpg but file.jpg. |
iconCObject | With this cObject you can set how the ###ICON### marker should see. |
iconCObject.makeThumbs | If you set this to 1 then by images thumbs will be created instead from icons. This option has stdWrap properties. |
iconCObject.file.width | The width of an icon. |
Into this field can you enter a directory and all files from this directory will be shown so you don't need to add eachfile separately
The value can be exploded by "|" into parameters:
1: The path
2: comma-list of allowed extensions (no spaces between); if empty all extensions goes.
3: sorting: name, size, ext, date
4: reverse: Set to "r" if you want a reversed sorting
Example:
with command
“fileadmin/myOrder/|jpg,gif,png|name|r”
you will become all jpg, gif and png files from fileadmin/myOrder directory sorted by name reverse.