Skip to content

Instantly share code, notes, and snippets.

@danfrost
Created November 29, 2011 12:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danfrost/1404675 to your computer and use it in GitHub Desktop.
Save danfrost/1404675 to your computer and use it in GitHub Desktop.
How to use TYPO3 hooks to customise what is displayed in a given listing.
# 1. Make an empty extension
# 2. ext_tables.php
<?php
require_once t3lib_extMgm::extPath('dblist_hook') . '/class.user_tx_belisthook.php';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['getTable'][] = 'user_tx_belisthook';
?>
# 3. class.user_tx_belisthook.php
<?php
class user_tx_belisthook implements t3lib_localRecordListGetTableHook
{
public function getDBlistQuery($table, $pageId, &$additionalWhereClause, &$selectedFieldsList, &$parentObject)
{
$additionalWhereClause .= ' and 0 '; # << whatever you like here
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment