Typo3 // news : Set Default value for excludeAlreadyDisplayedNews? - typo3

how do I set the default value für the field "excludeAlreadyDisplayedNews" in the news-Plugin for Typo3 (V9)
I tried
TCEFORM.tt_content.pi_flexform.tx_news.sDEF.settings.excludeAlreadyDisplayedNews=1
in the TSConfig, but this doesnt work....

Just via TypoScript settings
plugin.tx_news.settings.excludeAlreadyDisplayedNews = 1

Related

How to show username in frontend in TYPO3 10?

In TYPO3 9 I managed to display the current username in a FLUID-template with the following Typoscript:
[loginUser=*]
temp.username = TEXT
temp.username {
insertData = 1
value = {TSFE:fe_user|user|username}
noTrimWrap = | ||
}
[global]
In TYPO3 10.4 this is not working anymore. Any idea how to display the current user?
Many thanks! Urs
In Typo3 V10, you have to use the Context API to retrieve data from global objects, try this :
[frontend.user.isLoggedIn]
temp.username = TEXT
temp.username.data = TSFE:fe_user|user|name
temp.username.wrap = |
[global]
Have a look at those links :
https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/DataTypes/Index.html
https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/Context/Index.html#context-api
Florian
It's probably not working because you're using the old TypoScript conditions. Since TYPO3 9 the conditions work with Symfony expressions. The old conditions were deprecated in TYPO3 9 (but still worked) and removed in TYPO3 10. So [loginUser=*] will never be true in TYPO3 10. You should use [frontend.user.isLoggedIn] instead.
See https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/Conditions/Index.html for more about the new TypoScript conditions.
Why use TypoScript? It is very limited on what it can bring back. I just finished a tutorial where you can use a ViewHelper to add an ExtBase variable which assigns the whole user object in the FrontEnd and you can use it wherever you want with all it's relations, even the image, which is difficult to get via TypoScript.
TYPO3 tutorial
Best regards

How to set default colPos in TYPO3

We are setting up a news integration for one of our customers and he needs the content element feature. But when adding a new content element to the News the system always selects an inexisting colPos. Through this, you can't specify the type of the content element before the colPos got changed.
Is it possible to change the default colPos from 0 to 1 or so?
I have tried to set the colPos by following code in the PageTS but it hasn't worked out for me.
TCEFORM.tt_content.colPos.config.default = 1
TCAdefaults.tt_content.colPos = 1 will force default value for all tt_content entries in this page (page tree).
Best way would be to set default value for news content elements only. This can be done with override child TCA
In TYPO3 version 7.6
$GLOBALS['TCA']['tx_news_domain_model_news']['columns']['content_elements']['config']['foreign_record_defaults']['colPos'] = '1';
In TYPO3 version 8.6 and 9.5
$GLOBALS['TCA']['tx_news_domain_model_news']['columns']['content_elements']['config']['overrideChildTca']['columns']['colPos']['config']['default'] = '1';
This can be configured in a custom project extension under ../Configuration/TCA/Overrides/tx_news_domain_model_news.php
TCAdefaults.tt_content.colPos = 1
Works for me. Add it to the page's TSConfig.

How to get GET-Vars via typoscript as value in form field in Ext:form in TYPO3 6.2.32+

After updating a website from TYPO3 6.2.31 to 6.2.35 (ELTS) the following TypoScript code inside a form plugin doesn't work anymore.
20 = HIDDEN
20 {
name = myVar
value = TEXT
value.data = GP:myVar
}
I don't get the value from the GET var myVar into the hidden field.
There were a security issue fixed in 6.2.32
2017-08-29 3719867 [RELEASE] Release of TYPO3 ELTS 6.2.32
2017-08-24 eaa56c9 [SECURITY] Prevent insecure TypoScript processing in EXT:form
Any suggestions how to get it working again?

TYPO3 V7.6, default value for Number of Columns

How is it possible to set in Page TSConfig the default value for "Number of Columns" in TYPO3 V7.6? In erlier versions it was possible with TCEFORM.tt_content.imagecols = 1. If I set in V7.6 TCEFORM.tt_content.imagecols = 1 it makes no different which value is set. There is always imagecols = 2 set.
I have PHP 7.0.7 and use the rendering extension fluid_styled_content (not css_styled_content). Is there something I am missing?
Thanks in advance for your help.
TCAdefaults.tt_content.imagecols = 1
works for me in TYPO3 7.6.11
TCEFORM.tt_content.imagecols.config.default = 1 is not working, as described op.
Be aware: This config never works if you switch content type after saving a content:
https://forge.typo3.org/issues/75233

TYPO3 4.5.x set default pivar to fe_user uid

I have a page running TYPO3 4.5.x that has a singleview of a plugin (plugin.tx_browser). I would like the default pivar showUid to be the uid of the currently logged in user.
I can get the uid in typoscript with
data = TSFE:fe_user|user|uid
And I know I can set the piVar to a fixed value with
plugin.tx_browser_pi1._DEFAULT_PI_VARS.showUid = 575
but i can not set
plugin.tx_browser_pi1._DEFAULT_PI_VARS.showUid.data = TSFE:fe_user|user|uid
Is there a way to set the pivar thorugh typoscript dynamically?
The suggestion to use the stdWrap property unfortunately does not seem to work prior to TYPO3 6.2
Thanks
It's possible since Version 6.2. You just need to add the stdWrap property:
plugin.tx_browser_pi1._DEFAULT_PI_VARS.showUid.stdWrap.data = TSFE:fe_user|user|uid
See the the corresponding part in the TypoScript Reference.