Require to select a category for tt_news
Sunday, June 29th, 2008 | Author: Benni
If you have to customize a TYPO3 installation for your editors, and you use tt_news, you maybe have had the problem. Your editor gives you a call and let’s you know that he can’t see his just finished news in the frontend. You find out that the record is not hidden, but the problem is that the editor hasn’t had a category selected. Most likely it’s because the categories are on the second tab in the TCEforms. (in some cases where we “misue” tt_news, it’s the only thing that is on the second tab). However, the problem is then that the editor saves the record and forgets to attach a category to it. With this simple statement you can force the editor to select a category:
TCEFORM.tt_news.category.config.minitems = 1
This can be done on pagesTSconfig level but also on userTSconfig, and is quite helpful to save some support calls.


Monday, 30. June 2008
Good tip!
I re-discovered this TSConfig magic too a week ago. You can fiddle with the complete TCA. One thing I use for tt_news is:
// Set default values
TCAdefaults {
tt_news {
hidden = 0
author = Michiel Roos
author_email = michiel@typofree.org
}
}
And the realy good thing is that in the recent TYPO3 incarnations you can also use TCAdefaults in page TSConfig. So you no longer have to fiddle with a group ‘general settings’ or a group ‘all’, just add the TCAdefaults to the news folder or root page.
Tuesday, 8. July 2008
How can I set default value to category field ?
I try to add TSConfig:
# Set default values
TCAdefaults {
tt_news {
category = 1
}
}
But it does not works! Category is empty for new items.
Monday, 27. October 2008
http://typo3.org/extensions/repository/view/lab_newsfolders/current/ ?
Thursday, 8. January 2009
Hi Michiel,
Perhaps this one even makes it a little nicer for you:
http://typo3.intervation.de/snippets/backend/felder-vorbelegen.html
Cheers!
Wednesday, 25. February 2009
We at Acqal used to do similar coding to assign default names and emails to various TYPO3 records. However the TYPO3 extension cron_setdefaultauthor takes away that headache.
http://typo3.org/extensions/repository/view/cron_setdefaultauthor/current/
Wednesday, 29. April 2009
TCAdefaults.tt_news.category = 2,10,1