[TYPO3] Add file extensions to the "Filelinks" content element?

Bernhard Kraft kraftb at kraftb.at
Sat Feb 18 23:56:32 CET 2006


Bjarne HELLIGSOE wrote:
> Hi,
> 
> Simple question: Where and how do I add new file extensions to the 
> "Filelinks" content element?
> On a webpage I am using this element with links to WMV files, and the 
> element doesn't not know this file extension, and therefore using the 
> default icon. I would like to add the WMV extension.
> But how?
> 
> Thanks in advanced
> 
> Best Regards, Bjarne 
> 
> 

You would either have to rewrite the core-file

typo3/sysext/cms/tbl_ttcontent.php (or like that)

In the TCA you have a field

'media' => array(
...
   'allowed' => 'exe,png,bla,blub,add_yours_here',

or remove this line and add:

   'disallowed' => 'php,php3,php4,php5,cgi,sh'

(just for security reason so no editor uploads his own scripts)


Or you could write your own little extension (Do so by using the kickstarter -
configure nothing except "General" - choose "Backend" as type ... doesn't really
matter what you choose as type).

Then create a new "ext_tables.php" file in the new extension directory and put
the following code in it:

----------------------------
<?php
if (!defined ('TYPO3_MODE'))  die ('Access denied.');
t3lib_div::loadTCA('tt_content');
$TCA['tt_content']['columns']['media']['config']['allowed'] .= ',wmv';
?>
----------------------------

take care to not have any leading or trailing newline after the <? delimiters.


greets,
Bernhard



More information about the TYPO3-english mailing list