Claudia Posted May 24, 2023 Share Posted May 24, 2023 How is it decided in what order the tabs are shown in Products Admin, or Orders admin? I added a new tab after General but it is showing last. Shows: General - Description - Orders - Pricing - Categories Options - etc..... - Venue Info I want: General - Venue Info - Description - Orders - Pricing - Categories Options - etc..... Thanks for any and all help Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 24, 2023 Share Posted May 24, 2023 When the function call is made to add a tab, there is a parameter one can use to place it relative to other tabs. The thing is, the standard tabs show up in context, in the order the function is called. For example, in products.index.inc.php: Near lines 666-667: $GLOBALS['main']->addTabControl($lang['common']['general'], 'general'); $GLOBALS['main']->addTabControl($lang['common']['description'], 'description'); These two tabs will show only when adding/editing a product, and in this order. Thus we can assume the array element order index (the 'key' to an array) will be 0 to start and gets assigned to 'general'. Next, the index will be 1 and gets assigned to 'description'. The function call has these parameters: $name, $target = '', // the ID of the <div> with the content $url = null, $accesskey = null, $notify_count = false, $a_target = '_self', $priority = null, $onclick = '' So, $GLOBALS['main']->addTabControl("Venue Info", 'venue', null,null,false,'_self',1,''); The function will check if there is a tab already at priority=1, and if there is, add 0.01 to the priority passed in. Thus, when the array of tabs are ready for the template, a sorted array will put 'venue' (=1.01) after 'description' (=1). Not specifying a priority has the effect of placing the tab 'in sequence', that is, after those tabs already added via the function call sans priority, but before any other tabs added via the function call sans priority. So, the sequence depends on when the hook got played. Unless, as explained above, a priority value (greater than zero) is passed in. Quote Link to comment Share on other sites More sharing options...
Claudia Posted May 25, 2023 Author Share Posted May 25, 2023 Thanks Brian! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.