TYPO3: How to put TS-config of a page into a config file? - typo3

In the TS-Config of a backend-form I can disable the doktype field of said backend form by writing:
TCEFORM.pages {
doktype.disabled=1
}
How can I put this into a config file on the server? How can I use this just to certain uid's?
Thank you!

In the documentation you find all about integrating TSconfig via a file: https://docs.typo3.org/m/typo3/reference-tsconfig/9.5/en-us/UsingSetting/#setting-default-page-tsconfig
Also, you can use conditions in TSconfig, see: https://docs.typo3.org/m/typo3/reference-tsconfig/9.5/en-us/UsingSetting/Index.html#condition-references

Related

How to get the Log In Form on every page? (for example in footer) Typo3

Is there a way to get the Log In Form for Frontend User on every page? I would prefer the footer.
And if someone is logged in you can see the Log Out Button.
Is this possible without an extension?
You can copy the default felogin output to wherever you want on your template. For example use lib.login, copy the plugin.tx_felogin_pi1 into it, change the template and you're fine.
lib.login < plugin.tx_felogin_pi1
lib.login.templateFile = path/to/your/template/file
More you can see in the official documentation: https://docs.typo3.org/typo3cms/extensions/felogin/8.7/Configuration/Index.html
In general there are three options to include a CE (e.g. the Login-form) on all pages:
use typoscript to generate the CE. Normally the CEs are defined in tt_content, from where you could copy the base configuration and adapt it. For some plugins you also find a complete configuration beyond lib (for newer extensions there you only find the settings). All the configuration must be done in typoscript.
use typoscript to render the content of a special page/ column. In this variant you have a special page only for content referenced somewhere else. Advantage: you could configure the CE in the usual way. Try to avoid referencing CEs by uid as an editor might disable or delete the current element(s) and insert a new one which would not be rendered.
use a special column in your root page and inherit the content to all subpages. Advantage: you could change the inherited content easily on each page (if this column is available in the current backend layout).
example for 3:
variables {
footer_content < styles.content.get
footer_content.select.where = colPos = 15
footer_content.slide = -1
}

Where must finisher files (for powermail finisher) be located?

I am currently trying to add a finisher to my powerplay form.
The target is to delete all elements in a specific folder after the form is submited.
I currently use :
this tutorial
I first put this into my setup.txt
plugin.tx_powermail.settings.setup {
finishers {
1 {
class = Vendor\Ext\Finisher\DoSomethingFinisher
}
}
}
at this location: ftp://ftpIP/typo3cms/pagename/typo3conf/ext/powermail/Configuration/TypoScript/Main/setup.txt
Now i should create a PHP-File:
Add a php-file DoSomethingFinisher.php and extend your class with the AbstractFinisher from powermail:
But where shuld I place that PHP File? In the same place as the setup.txt?
Hope someone can help. Thank you very much.
Thomas
That question is related to TYPO3 autoloading and not to powermail. If you want to add PHP-Files to your TYPO3, you should use an extension.
There are some manuals how to get the autoloading to work with your PHP-Files (see https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/Autoloading/Index.html).
You shouldn't modify the files in the folder powermail, otherwise you will be in trouble when you want to update the extension. Instead, create a new extension with extension_builder or take powermailextended and modify that extension.
Assuming you use powermailextended:
If you call the Finisher In2code\Powermailextended\Finisher\MyFinisher, then it needs to go in EXT:powermailextend\Classes\Finisher\MyFinisher - this is how Typo3 autoloads the PHP files.

Why can't I access my extensions' settings on the frontend?

Trying to access a few settings that I've created in my constants.txt file. It looks like this:
plugin.tx_my_ext {
settings {
# cat=plugin.tx_my_ext/urgences; type=boolean; label=Activer les urgences
activerUrgences = 0
}
}
Then in my setup.txt file I have this:
plugin.tx_my_ext.settings.activerUrgences = {$plugin.tx_my_ext.settings.activerUrgences}
Any reason why I wouldn't be able to access my settings using {settings} in my Fluid layout?
BTW, my extension name does include an underscore _ between the words. I have tried removing the underscore, then removing the tx_, and then a combination of those two.
Any help would be appreciated!
Thanks
For ext with key my_ext it should be plugin.tx_myext.settings
Make sure that you 'Included static from extension' in your TypoScript Template. If your ext is not available on the list add it in ext_localconf.php like that:
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'MyExt');
Do not forget to clear System cache and FE cache at least million times ;)
Use TypoScript object browser to check if on given page your plugins TS is still available (maybe something resets TS in meanwhile:
Finally make sure that you don't clear $this->settings array within your controller, if you do manipulate it for any reason assign it to the view again before view rendering,like that:
$this->view->assign('settings', $this->settings);

How to rename subheader in TYPO3 CMS backend

How can I rename a TYPO3 CMS backend field for authors? i.e. the mentioned field for content-elements of csc_styled_content?
In general, overriding label names can by done with Page TSconfig in the backend. The following example modifies the label of the subheader field.
TCEFORM {
tt_content {
subheader.label = My new Label-Name
}
}
There are two way to configure that adjustment in TYPO3.
Type your configuration changes directly to the page settings » resources » TypoScript Configuration » Page TSConfig (see the screenshot below)
as an alternative you can store that configuration directly in the file system - either in your custom extension (e.g. at typo3conf/ext/my_extension/Configuration/TSconfig/labels.t3s) or with a similar name in the global file storage (e.g. fileadmin/templates/configuration/...)
That's basically it to provide custom labels for any database table in the TYPO3 backend. Find more aspects that can be adjusted in the accordant Page TSconfig documentation.
If you want to rename a field of an extension like tx_news you could do it this way.
TCEFORM {
tx_news_domain_model_news {
title.label = Your New Label
}
}
Now there are two ways to get this to work:
Put it in Page TSConfig of the page settings
OR
Load it with your extension from a file (e.g. EXT:my_extension/Configuration/pageTSConfig.typoscript). For that you have to import this script by EXT:my_extension/ext_localconf.php!
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:my_extrension/Configuration/pageTSConfig.typoscript">');

TYPO3 Extension output altered by TYPO3?

TYPO3 seems to alter the output of my Frontend extension.
Simple Testcase:
function main($content, $conf)
{
$this->conf = $conf;
$this->pi_setPiVarDefaults();
$this->pi_loadLL();
return 'test';
}
When I call a page with this extension in the frontend i get:
test
Basically it prepends the path I used to access the page to the anchor link.
What could be responsible for this behaviour? RealURL?
How can I disable it?
You probably have somwhere in your TS template (in Setup) enabled prefixing:
config.prefixLocalAnchors = all
Note, that if you have set config.baseURL=http://some.tld/ and enabled RealURL this is required, otherwise all anchor links will be redirected to the main page:
http://some.tld/#test
instead of
http://some.tld/pagename/sub/other-sub#test