Node Click Events

Learn how to hook on to tree node click events

Important. This guide and sample code are only intended for C1 CMS Versions earlier than 5.0.

Whenever the user clicks a node in the tree in the CMS Console, an 'OnFocus' event is fired. You can hook on to this event to perform custom actions.

In this quick guide, you will learn how to intercept clicks on tree nodes in the Media perspective (media files/folders) and show custom content in the "default" view in response to the clicks.

The user will open the view manually. When the user clicks a media folder, all its images in that folder will be listed in the view as thumbnails. And when the user clicks an image file, its scaled down copy will appear in the same view.

To implement this functionality:

  1. Create a Webform that will load in the default view and list images when folders and files are clicked in the tree.
  2. Create a custom page binding where you will subscribe for the OnFocus event to update the view for a specific node.
  3. Attach an action to media files/folders using an action executor that opens the Webform in the view.

Sample Code

The above functionality can be downloaded and installed as CMS Packages:

Note. Install Composite.Prototype.MediaExplorer.AttachAction (to register the action element provider in Composite.config) after installing Composite.Prototype.MediaExplorer.

Requirements

  • C1 CMS version 4.3 or earlier