Search code examples
configurationtypo3hidetx-news

Typo3 6.0 - TCA - news - hide certain types of news in select field


I am new to typo3, and I need help concerning the News extension and the $TCA configuration.

I have made an extension called "Activité" which extends from News. This went pretty well. I created some custom fields and I was able to make my extension "selectable" from the select field already available in the "General" tab.

All I want to do is to hide the default selectable fields already there (in this case, I want to hide "Internal page" and "External page".

It seems so simple, but I want to do this the right way.


Solution

  • You did not write what news extension you use. For old one tt_news you disable by

    TCEFORM.tt_news.type.removeItems = 1,2
    

    for new one "news" by

    TCEFORM.tx_news_domain_model_news.type.removeItems = 1,2
    

    General syntax is:

    TCEFORM.[table_name].[field_name].[action]
    

    For example you can completyl disable not used fields with

    TCEFORM.[table_name].[field_name].disabled = 1
    

    You can also set default values to fields with syntax

    TCAdefaults.[table_name].[field_name] = value
    

    You should add this typoscript in page propertes. Tab "Resources", field TypoScript Configuration / Page TSConfig.