View Single Post
  #1  
Old 05-15-2021, 11:51 AM
  The Knotty Celt's Avatar 
The Knotty Celt The Knotty Celt is offline
 

Advanced Member
  
Join Date: Jan 2020
Posts: 32
 

Default Adding Tabs to Admin Pages

So, I followed this guide (https://devs.x-cart.com/design_changes/adding_tabs.html) in order to learn how to add a tab to an Admin Page. It worked in adding the custom tab to the Products page, however; when I tried to implement the same procedure to add a tab to the Front Page settings page, it simply added the body of my tab's template between the page title and the row of tabs.

Code:
<?php // vim: set ts=4 sw=4 sts=4 et: namespace XLite\Module\LBS\MultiLingualBanner\Controller\Admin; /** * Front Page */ abstract class FrontPage extends \XLite\Controller\Admin\FrontPage implements \XLite\Base\IDecorator { public function getPages() { $list = parent::getPages(); $list['custom_tab'] = 'My Custom Tab'; return $list; } protected function getPageTemplates() { $list = parent::getPageTemplates(); $list['custom_tab'] = 'modules/LBS/MultiLingualBanner/tab/custom_tab.twig'; return $list; } }


Are the tabs on this page handled differently than those on the Products page? How can I properly place my template as a tab on the Front Page settings page?
__________________
X-Cart version 5.4.1.46
PHP version 7.4.33
MySQL version 15.1
Apache version 2.4.56
cURL version 7.74.0
Reply With Quote