#21486Module web_layout should allow to force-show other tables
Description
The “page view” will always show a box and new-element-icon for tt_content, but not for other tables like tt_news even if they are configured to be displayed in this view as well.
Especially since the “create new record” link has been removed from page view, this option is very desireable at least for some pages. Because if users only get access to this module but not the list view, they have no way of inserting items into other tables, if there are none of the same type in that page already. Also, for news folders, you might even want to disable the standard content section.
This functionality can be added by just a few additions to the code…
(See Additional Information)
>>> /typo3/sysext/cms/layout/class.tx_cms_layout.php
##### function getTableMenu($id) #########
Replace:
// If records were found (or if “tt_content” is the table…):
if ($c || t3lib_div::inList(‘tt_content’,$tName)) {
By:
$forceTables = $GLOBALS[‘BE_USER’]->getTSConfig(‘mod.web_layout.forceTables’,t3lib_BEfunc::getPagesTSconfig($id));
if ($forceTables[‘value’]) $forceTables = str_replace(’ ‘,’‘,$forceTables[‘value’]); else $forceTables = ‘tt_content’;
// If records were found (or if display forced in TSconfig):
if ($c || t3lib_div::inList($forceTables,$tName)) {
##### function makeOrdinaryList(….) #########
remove the condition:
if ($dbCount) {
This is because for other tables, if there are no records, the list including the “new” icon would not be displayed.
(issue imported from #M12497)
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.