[TYPO3] File references in custom extension

Stano Paška stano.paska at gmail.com
Tue Jul 1 16:46:55 CEST 2008


Hi,

Aaaa, in your extension...

then you must add this in your tca.php

$dam_file = txdam_getMediaTCA('media_field', 'dummy');
unset($dam_file['config']['disallowed_types']);

unset($TCA['tx_spcdalbums_track']['columns']['audio']['config']);
$TCA['tx_spcdalbums_track']['columns']['audio']['config'] = $dam_file['config'];
$TCA['tx_spcdalbums_track']['columns']['audio']['config']['maxitems'] = 1;
$TCA['tx_spcdalbums_track']['columns']['audio']['config']['allowed_types']
= 'mp3';
$TCA['tx_spcdalbums_track']['columns']['audio']['config']['MM_match_fields']['ident']
= 'audio';

and in your pi1 php file you can get list of files:
	function getReferencedImages($table, $column, $id) {

		$pole = array();
		$aaa = tx_dam_db::getReferencedFiles($table, $id,
			$column, 'tx_dam_mm_ref',
'tx_dam.uid,tx_dam.caption,tx_dam.file_path,tx_dam.file_name');
		foreach (array_keys($aaa['files']) as $img_id) {
			$pole[] = array('path' => $aaa['files'][$img_id],
				'caption' => $aaa['rows'][$img_id]['caption']);
		}
		return $pole;
	}

Hope this help.

Stano.

On Tue, Jul 1, 2008 at 3:09 PM, Michael Niemann
<xml.transformator at yahoo.com> wrote:
> Hello,
>
> I still have issues with files in my custom extension.
> It creates links to files which are stored in the /fileadmin/media directory. Whenever I chose to reference an existing file it creates a copy of that file.
>
> Is there some switch in TYPO3 to change this behaviour? In my case I have PDF files of more than 10MB in size. Some of them are referenced 10 or twenty times. You can images the increase of disk usage. Not to speak of updating a PDF and having to update all references.
>
> This is a very bogus feature which needs some control.
>
> Regards Michael
>
>
>
>
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
>


More information about the TYPO3-english mailing list