Issue Feature Under Review Quiet

#105560Select node of page tree via JS/PHP

Philipp Kitzberger 11/08/24, 16:57 updated 09/23/26, 20:51

Description

In previous versions of TYPO3 it’s been possible to select a node of the page tree via JS:

<script type="text/javascript">
  if (top && top.TYPO3.Backend.NavigationContainer.PageTree) {
    top.TYPO3.Backend.NavigationContainer.PageTree.select(76);
  }
</script>

Unfortunately that’s gone for some time now.

Since TYPO3 11 there’s proper backend routing, so linking to a (custom) BE module is possible and often done with the `id` parameter to open a module “on” a specific page. Unfortunately the page tree doesn’t reflect that new node. Is there a reason behind that?

Nevertheless it’d be great to have the possibility as a developer of a BE module to be able to update the selected node of the page tree.

Analog to this snippet maybe?

<f:be.pageRenderer includeJavaScriptModules="{
   1: '@typo3/backend/element/immediate-action-element.js'
}" />
<f:variable name="args" value="{0:'typo3:pagetree:mountPoint',1:{pageId:22},2:1}"/>
<typo3-immediate-action
    action="TYPO3.Backend.Event.EventDispatcher.dispatchCustomEvent"
    args="{args -> f:format.json() -> f:format.htmlspecialchars()}"
></typo3-immediate-action>

Reviews 1

History 26