Last Updated: February 25, 2016
·
8.005K
· mogensen

Hiding entire tables from the List View

Or: "Make all that nasty tables go bye bye!!!"

In the following I describe how to remove specific tables from the "list view" in the TYPO3 backend.

I find this useful in extensions where I have an inline relation in my object model, and I don't want the inline objects to show in the list view. Or when other extensions introduce table records that my backend editors don't need to see.
Luckily the list module has a very simple way of hiding the unwanted tables. All tables!

Page TSconfig

The first thing we need to do, is to define which tables we want to hide:

mod.web_list.table.tx_myext_domain_model_car.hideTable = 1
mod.web_list.table.tx_myext_domain_model_seat.hideTable = 1
mod.web_list.table.tx_myext_domain_model_wheels.hideTable = 1

This configuration can be added to the Page TSConfig field of a page. Or if we are in the context of an extension, we can create a new configuration file to contain page TSconfig configuration for our extension. For example adding the configuration above to:

Configuration/pageTS/pageTSconfig.txt

If we want to make sure that these tables are never shown we can add the following to the ext_localconf.php file.

t3lib_extMgm::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $_EXTKEY . '/Configuration/pageTS/pageTSconfig.txt">');

This will autoload our new pageTS configuration, and make sure that the tables are not listed.

Alternative solution

I prefer this solution, because it allows me to easily hide all table, and not only the ones from my own extensions.
If you only wise to hide tables created by your own extensions, you may consider using the TCA for this. In ext_tables.php add the following configuration:

$TCA['tx_myext_domain_model_car']['ctrl']['hideTable'] = 1;
$TCA['tx_myext_domain_model_seat']['ctrl']['hideTable'] = 1;
$TCA['tx_myext_domain_model_wheel']['ctrl']['hideTable'] = 1;