Blog
15MarPimp my Backend: TCAmanipulate
Posted on March 15, 2010 in Extension Development,Extensions,TypoScript byA while back we a colleague of mine discover this sweet extension in the TER, after experimenting with it a little we discovered that it was actually quite cool and very useful! Basically, it allows you to reset and rearrange any TCA settings with TypoScript through Page TSconfig.

So what could we use this for?
Let's make a hypothetical assumption, that we would like the extension tt_news for more things than just displaying news. It has a list, single and latest view, categories and lots of other useful stuff that you might want to use for something else as well. Of course our customer is going to be confused to see all the records as news records. This is where a little TCA manipulation can be useful. We can use the same database table for storage, have the same features on the front-end. However, our dear customer will not see that we are using tt_news in the back-end.
Sounds cool, so what do we need?
It's pretty basic to install, just download and upload/import the extension and install it. After that we are already ready to use it. Now I can start bragging on how to set it up, but of course it would be a lot easier and more clear to give a nice little example :-)
An example..
In this example, I would like to use tt_news for 2 things. The first will be standard, displaying news. So for this we are going to leave everything as it is. The next thing we want to achieve, is to use tt_news to store portfolio items. We could do something like this because we will have the same properties as tt_news. Single, list and latest view, and we would like to categorize them. The only difference between this and news will be the name and some of the fields. The portfolio items will for example only have the following details.
- Name (title)
- Website (links)
- Category (category)
- Short description (short)
- Full description (bodytext
- Date (datetime)
This should already not be a problem with normal Page TSconfig, but it's made even easier with TCAmanipulate. We can use the exact same structure as is found in tca.php files found in extensions. What are going to do first is change the table headers and record icons. We do this by entering the following code in the Page TSconfig.
Converting news articles to portfolio items 
- TCA.tt_news {
- ctrl {
- title = Portfolio items
- iconfile = /fileadmin/images/icons/portfolio.gif
- }
- }
- TCA.tt_news_cat {
- ctrl {
- title = Categories
- iconfile = /fileadmin/images/icons/category.gif
- }
- }
TCA.tt_news {
ctrl {
title = Portfolio items
iconfile = /fileadmin/images/icons/portfolio.gif
}
}
TCA.tt_news_cat {
ctrl {
title = Categories
iconfile = /fileadmin/images/icons/category.gif
}
}
This will transform our list view (only from this page) from this:

To this:

Now the next thing we want to do is disable and rearrange some fields. Now normally we could already disable fields with Page TSconfig, but we would have to disable each field seperately. With this cool tool we can simply just re-specify the fields that we want to have displayed :-) We will display only the fields mentioned above. And to make it even more fun, we will put a tab divider in it as well.
Redefining what fields should be displayed, and adding a divider (tab) 
- TCA.tt_news.types.0.showitem = datetime,title,short,bodytext,--div--;Relations,links,category
TCA.tt_news.types.0.showitem = datetime,title,short,bodytext,--div--;Relations,links,category
Next to the fact that we can easily say which fields should be displayed, we can also change their behavior and appearance with some small settings. Let's say we want to change the labels of these fields as well, and also make it only possible to select only 1 category. Let's just add some more TS to it :-)
Redefine what the fields should look like 
- TCA.tt_news.columns {
- short.label = Short description
- bodytext.label = Long description
- category.config.size = 1
- category.config.maxitems = 1
- }
TCA.tt_news.columns {
short.label = Short description
bodytext.label = Long description
category.config.size = 1
category.config.maxitems = 1
}
Now if we edit a "news" record we will get something like this:

Conclusion
This extension can prove extremely useful in some situations, and may prevent you from modifying extensions in order to get your back-end display to what you want. In my opinion this would be a nice thing to have in the TYPO3 core.



at 10:41
Who needs to make his own extension when some extensions with different names would rock the same way.!
I totally agree that this would be a good addition to the typo3core.
at 17:15
Doesn't seems to work with tt_news 3.0 ?
Hi Sebastiaan,
I tried to manipulate the tt_news 3.0.1, but doesn't seems te work.
I managed to change the titles only.
I can't change the icons and hide some fields (author , author email etc etc)
Graag wat help aub?
Idar
at 08:22
Doesn't seems to work with tt_news 3.0 ?
Can you give me some pointers in tt_news 3.0
In this newest version, the TCA manipulate, doesn't seems to work!
groetjes,
Idar
at 09:24
RE: Doesn't seems to work with tt_news 3.0 ?
Hey Idar,
Sorry, your previous comment got stuck as being invisible :-)
Sure, but can you show me the code you've used (use pastebin or something for the snippet) and what you are trying to achieve?
Cheers,
Sebastiaan
at 08:04
typeicons and typo3 4.4
I'm having problems changing the typeicons for tt_news 3.0.1 in typo3 4.4.*
TCA {
tt_news {
...
ctrl.typeicons {
1 = blog_icon.jpg
}
...
}
}
Works fine in 4.3.* but not in 4.4.*
Any clue as to why?
at 14:24
RE: typeicons and typo3 4.4
Hi Chris,
To be honest I haven't tried out TCA manipulate together with tt_news 3.x. However there are some deprecated function problems from I think 4.4 already with TCA manipulate. Have you modified the extension by any chance (there's a ereg_replace stuck in the code of the extension somewhere.
Cheers,
Sebastiaan