3

Removing the "Select & Upload Files" button from Page properties works with the following line in PageTSConfig:

TCEFORM.pages.media.config.appearance.fileUploadAllowed = 0

Now I want to remove the "Select & Upload Files" button within content elements (for example with CType "textmedia"), too.

I tried out several things, but with no success. I found no working PageTSConfig "rule" for this case. Does somebody know how the "Select & Upload Files" button can be removed for content elements like textmedia elements?

Using TYPO3 8.7.1

3 Answers 3

8

The code you use is always the same.

In PageTsConfig you have to use:

TCEFORM.[TABLE].[COLUMN].config.appearance.fileUploadAllowed = 0

In TCA you have to use:

$GLOBALS['TCA']['TABLE']['columns']['COLUMN']['config']['appearance']['fileUploadAllowed'] = 0;

You have to replace TABLE with the table you want to modify and COLUMN with the column you want to modify.

In page properties you have pages as TABLE and media as COLUMN.
In textmedia you have tt_content as TABLE and assets (i think) as COLUMN.

0
4

You can set for each field separately, see post from Kevin Appelt. In this case you need to remember for any further field in future to add this setting too. To adapt file upload for all fields globaly, you can use UserTSConfig edit_docModuleUpload. See https://docs.typo3.org/typo3cms/TSconfigReference/singlehtml/Index.html#document-UserTsconfig/Setup/Index

To avoid file upload for all fields simple add to ext_localconf.php of your customer extension (sitepackage):

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('setup.override.edit_docModuleUpload = 0');

If you want use a separate configuration file for UserTSConfig, which I recommend add to ext_localconf.php

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:sitepackage/Configuration/TypoScript/User/Default.ts">');

and in your extension /Configuration/TypoScript/User/Default.ts

setup.override.edit_docModuleUpload = 0

If you also want exclude file upload and folder creation in file element browser (popup window) add following code to your extension /Configuration/TypoScript/User/Default.ts

# Hide 'file upload' and 'create folder' in link- and element browser
options.folderTree.uploadFieldsInLinkBrowser = 0
options.folderTree.hideCreateFolder = 1
options.createFoldersInEB = 1
0
0

This is a very simple way to remove "Select & Upload Files" button

User settings -> Edit and Advanced functions -> File upload directly in Doc-module(uncheck this checkbox)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.