Zum Inhalt springen

renderMode tree

Erstellt am 19. November 2012 · 2 Antworten · letzte Antwort am 26. November 2012

Tags: Frage

hardcoder ·

Hallo Community,

ich habe ein Problem mit TCA -> select -> renderMode -> tree. Es wird nur roodUid gezeigt. Ich habe festgestellt das:

$this->itemWhiteList

in

t3lib/tree/tca/class.t3lib_tree_tca_databasetreedataprovider.php (Typo3 4.5.22)

leer ist.

ändere ich entsrp. Bedingung (Z. 386) in der unten gezeigten Funktion, bekomme ich mein gewünschtes Ergebnis.

	protected function getRelatedRecords(array $row) {
		if ($this->getLookupMode() == t3lib_tree_tca_DatabaseTreeDataProvider::MODE_PARENT) {
			$children = $this->getChildrenUidsFromParentRelation($row);
		} else {
			$children = $this->getChildrenUidsFromChildrenRelation($row);
		}

		$allowedArray = array();
		foreach ($children as $child) {
			if (!in_array($child, $this->idCache) && in_array($child, $this->itemWhiteList)) {
				$allowedArray[] = $child;
			}
		}

		$this->idCache = array_merge($this->idCache, $allowedArray);

		return $allowedArray;
	}

wie befülle ich die Whitelist?

hardcoder ·

Falls der obige link "das Zeitliche gesegnet" hat:

Writing a TYPO3 extension, I needed to allow records of a certain table to be created on TYPO3's root page (pid=0). While the solution is easy, it took me a while to find it.

In ext_tables.php, add a rootLevel setting to your table's ctrl array:

$TCA['static_countries'] = array(
    'ctrl' => array(
        'title'     => 'Countries',
        'label'     => 'cn_short_en',
        'rootLevel' => 1,
    ...
/*

TYPO3 allows three settings here: 0, 1 and -1, which are described in the Core API documentation:

rootLevel = 0
Records may only exist in the page tree, not in the root.
rootLevel = 1
Records may only exist in the root, not on the page tree. Note that only admins may edit records in the root page.
rootLevel = -1
Records may exist in both the root and the page tree.
*/