List view new record category label name TYPO3 - typo3

I create some custom content elements with tt_content, typoscript and tsconfig etc. in a config extension. All works nice.
When changing to list view my custom content element gets listed under 'pen', which seems to be derived from either the extensionname or a table.
How can I set this name? See image.

You're right that the shown text depends on the table indirectly.
Here is the essential code shown how the name is determined depending on the table-configuration in TCA:
$temp = explode(':', substr($v['ctrl']['title'], 9 + strlen($_EXTKEY)));
$langFile = $temp[0];
$thisTitle = $lang->sL('LLL:EXT:' . $_EXTKEY . '/' . $langFile . ':extension.title');
This snippet is copied from the file typo3/sysext/backend/Classes/Controller/NewRecordController.php in the method renderNewRecordControls().
So in the end the text is determined in the language file(s) of your extension.

Related

TYPO3 Remove "Select & Upload Files" button

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
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.
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
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)

TYPO3: Custom content element - TCA fields configuration

I followed a tutorial to implement custom content elements in TYPO3. I don't understand how to configure backend fields.
Here is my override for tt_content:
$GLOBALS['TCA']['tt_content']['types']['my_custom_ce'] = [
'showitem' => '
--palette--;' . $frontendLanguageFilePrefix . 'palette.general;general,
--linebreak--, header;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:header_formlabel,
--linebreak--, date;Datum,
--linebreak--, media;Media,
--linebreak--, bodytext;text,
];
I would like for example to change the textarea size for the "bodytext" field. I read the official TCA reference but still don't get how this is working
The change of textarea fild size is done in
$GLOBALS['TCA']['tt_content']['columns']['bodytext']['config'] etc.
Look for details in the TCA reference.
This changes the field size for all CEs. As far as I know it is not possible to change this only for one CE.

How to hide the output comming from an inherited content element?

On a sub page I am inheriting multiple content elements from a parent page. Now I need to hide one of them, while keeping the rest untouched.
Any ideas?
One idea would be to use TypoScript to hide the output from the respective content element or plugin.
Identify the responsible element for the output using TYPO3 ADMIN PANEL.
Create a new template for the page (List view) and add the necessary configuration in the Setup field.
Below is an example:
[globalVar = TSFE:id = YOURPAGEID]
plugin.tx_exampleplugin >
[global]

TYPO3: Flipped Images in Fluid Template?

i want to Flip a bunch of Images vertically. In Typoscript i would do that with filelist and the GIFBUILDER Object.
But my Situation is now, that i use a custom Plugin with Extbase Classes and a Fluid Template.
I'm inserting the Images via ...
Does anybody know a good way to vertically flip these images before showing them?
Any Combination of Typoscript and Fluid maybe?
Thanks for your help!
I solved it like this:
In my Extbase Controller i have instantiated t3lib_stdGraphic an transformed the imageas via Imagick. The i saved this image to a directory -> Because i need it in a persistent memory.
The code maybe helpful because i didn't found any good resource for imagick-using in Extbase.
$this->stdGraphic = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_stdGraphic' );
$this->stdGraphic->absPrefix = PATH_site;
$this->stdGraphic->init();
$data = getimagesize("fileadmin/buegel_anprobe/".$artikel->getKurznr().".png");
$width = $data[0];
$height = $data[1];
$transform = $this->stdGraphic->imageMagickConvert("fileadmin/".$artikelname.".png",'png', $width, $height, ' -flop', '', '', 1);
$filepath = $transform[3]
' -flop' is the important argument to flip the image vertically
Then i passed the path to the fluid template and insert it via image-viewhelper
Good resource was the following reference: http://doc-typo3.ameos.com/4.1.0/classt3lib__stdGraphic.html
You have two options in my eyes:
First to write your typoscript as usual (e.g. lib.marks.YOUR-IMAGES = CONTENT or something) and render it via <f:cObject typoscriptObjectPath="lib.marks.YOUR-IMAGES"/>.
Second is to write your own view helper and extending the image view helper included in fluid. You can put your special config in there and use it instead of the normal one.

TYPO3: How do I insert page content into template

I have some content that I want to appear on multiple pages of my TYPO3 site. I could just insert this into the template, but I also want that content to be editable in the Rich Text Editor.
So I had the idea of creating a hidden page, but I don't know how to insert this content into a template.
Does it require the select typoscript statement?
Also, as a follow-up question, can I add something to say, only include pages that have this page id as their immediate parent in the page hierarchy.
I didn't quite get the second question.
If you want to include some record only to pages under some other page, then this will obviously work:
[PIDinRootline = pages-uid, pages-uid, ...]
temp.foo = RECORDS
temp.foo {
tables = tt_content
source = ID # Enter the object's ID here
}
[end]
On the other hand, if you want to include all records from pages, being children of some other page, then try something like:
1 = CONTENT
1.table = tt_content
1.select {
pidInList = parent-uid
}
Don't know if I got you right though.
Dmitri.
From Include typo3 content elements on every page:
temp.foo = RECORDS
temp.foo {
tables = tt_content
source = ID # Enter the object's ID here
}
Note the ID is the content record ID, not the page ID.
But that doesn't answer the question of how to only include pages/records with a certain parent.
You can set up a hidden page and then "import" the content elements on a given page via typoscript on the pages (or the entire page tree below) as needed.
The "trick" is to use the colPos with the select-statement. With this you can even put multiple (different) content elements in one (hidden) page that show up on different pages (depending on the setting of the column they are "in".
Example:
Create a hidden (or system) page (here example-pageid = $PID_STATIC)
Create a content element on this page (text)
Edit this content element to be shown on the right column (right equals colPos=2)
Put the following typoscript into the template on which you want the content element to be shown. You can set the pid (pageId) in the constants via PID_STATIC or "hardcode" it into the typoscript.
.
lib.aditionalcontent = COA
lib.aditionalcontent {
10 = CONTENT
10 {
table = tt_content
select.where = colPos = 2
select.orderBy = sorting
select.pidInList = {$PID_STATIC}
}
Add the element lib.aditionalcontent into your template where the content should be shown. For example:
.
page.10 = TEMPLATE
page.10.template = FILE
page.10.template.file = fileadmin/maintemplate.htm
page.10.workOnSubpart = DOCUMENT_BODY
page.10.marks.ADITIONAL_CONTENT < lib.aditionalcontent
.
Watch out, that you set the colPos according to the column that you have set the content element into, otherwise it just will not show.
You can use different columns to do this for different content that has to show up/should not show up on a particular page.
This also works with sytemfolders and non-hidden pages.
If you use TemplaVoila, this should also work although you have to switch to the listview to see and set the colum for the content element (if not hidden for this non-admin user).
To find out which colPos-number is which position of the column go to the phpMyAdmin and search for the field "colPos" in the tt_content table.