Change a subpanel in according with a condition:
1. Create your custom subpanel in /custom/modules/<YOUR_MODULE>/metadata/subpanels/<SUBPANEL_NAME>.php
2. In /custom/Extension/modules/<YOUR_MODULE>/Ext/Layoutdefs/<YOUR_LAYOUT>.php
Add your condition including ['override_subpanel_name'] in ['subpanel_setup'] array, after the declaration of your subpanel.
For example, add the following code:
Here we change to a specific subpanel if the current user is an Admin, the default subpanel is declared in ['subpanel_setup'] array.PHP Code:global $current_user;
if(is_admin($current_user)) $layout_defs['<YOUR_MODULE_1>']['subpanel_setup' ['<YOUR_MODULE_2>']['override_subpanel_name'] = '<YOUR_LAYOUT>';


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks