TYPO3 V7.6, default value for Number of Columns - typo3

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

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 customize field size in TYPO3 BE

I'm using TYPO3 since version 3 but I have never tried to customize the TYPO3 BE.
Now, what annoys me more in the BE is that in 'Special Menus' the 'Selected Pages' field displays 3 lines by default. I wish to expand it to at least 10 lines.
Inspecting the BE page with FF Developer Tools shows:
<select id="tceforms-multiselect-57f39f13067b0673730065" size="3" class="formField.
Editing the size value to 10 in the Inspector is exactly what I need.
How could I change that size value in TYPO3?
#Markusson and #Vimal Usadadiya
As suggested deactivating and activating the extension did the trick. BTW no need to use Global. The code I put in ext_tables.php is:
$TCA['tt_content']['columns']['pages']['config']['size'] = 10;
You can override the default value by using below lines. You can put that lines into ext_tables.php file in your custom extension.
unset($GLOBALS['TCA']['table_name']['columns']['field_name']['config']['size']);
$GLOBALS['TCA']['table_name']['columns']['field_name']['config']['size'] = 10;
You can override this in your own extension via
$GLOBALS['TCA']['tt_content']['columns']['pages']['config']['size'] = 10;
Put it in ext:your_ext/Configuration/TCA/Overrides/tt_content.php
alternative in ext:your_ext/ext_localconf.php
TYPO3 Reference to override TCA

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.

TYPO3 news (tx_news) ordering of records not working

I'm running TYPO3 V6 and the latest version of tx_news (not tt_news) and when I attempt to change the order of sorting for the LIST display, the settings in the plugin are not overriding the Typoscript settings. There doesn't seem to be a way to change to sort order of articles in the list view. I am aware that flagging a news record as "top news" will float it to the top of the list, but none of my records have that flag set.
Has anyone else had this problem?
I got the same problem: My listview always showed the oldest news on the top. I've been searching for a solution for hours. As i wanted to start to change the extension files manually, I found the "setup.txt" in the configuration folder. From there I copied the following code into my Typoscript. The problem is solved now.
plugin.tx_news{
settings{
overrideFlexformSettingsIfEmpty = cropMaxCharacters,dateField,timeRestriction,orderBy,orderDirection,backPid,listPid,startingpoint,recursive
orderBy = datetime
orderDirection = desc
orderByRespectTopNews = 0
orderByAllowed = sorting,author,uid,title,teaser,author,tstamp,crdate,datetime,categories.title
list{
paginate {
itemsPerPage=4
insertBelow=TRUE
lessPages=TRUE
#forcedNumberOfLinks=3
pagesBefore=1
pagesAfter=1
}
}
}
}
You can ignore the pagination lines. Important is the orderby stuff.
Typo3 Version: 4.7 (not my fault :D )
News System Version: 2.3
Found the solution to this one - basically I had been loading the TS setup code from an external file, which was overriding the default TS setup from the Typoscript template setup field, or rather, it wasn't. I duplicated the TS code in the Typoscript template and the external file and finally it is being recognised and the fields can be sorted.