[TYPO3-dev] 4.5 pagetree API to get page uids of all subpages of a page
Steffen Müller
typo3 at t3node.com
Mon Mar 28 15:38:54 CEST 2011
Hi.
I am developing two clickmenu items for the new pagetree in 4.5 to
delete the page cache of
1) a single page (clearPageCache)
2) a page with all its subpages (clearBranchCache).
Part 1) is already working.
Part 2) lacks of a good way to fetch subpages recursively.
Unfortunately, t3lib_TCEmain::clear_cacheCmd() does not provide a way to
recursively clear the page cache of a given page id. So I guess I have
to do that myself.
I am looking for a way to get the uids of all subpages (children) of a
page.
My extension looks like this:
JS:
Ext.onReady(function() {
Ext.apply(TYPO3.Components.PageTree.Actions, {
clearBranchCache: function(node, tree) {
TYPO3.Smclearcachecm.ClickmenuAction.clearBranchCache(
node.attributes.nodeData
);
}
});
});
PHP:
public function clearBranchCache($nodeData) {
$node = t3lib_div::makeInstance('t3lib_tree_pagetree_Node', (array)
$nodeData);
}
I tried to use
$node->getChildNodes()
$node->hasChildNodes()
which are members of inherited t3lib_tree_Node. The result is always NULL.
What's missing here? How do I get childNodes? Does the pagetree API
provide such function?
Thanks for your suggestions.
--
cheers,
Steffen
TYPO3 Blog: http://www.t3node.com/
Twitter: http://twitter.com/t3node
More information about the TYPO3-dev
mailing list