View Single Post
  #3  
Old 02-10-2017, 07:35 AM
 
xgarb xgarb is offline
 

eXpert
  
Join Date: Jul 2004
Location: UK
Posts: 263
 

Default Re: Removing SimpleCMS primary_menu.css from CSS list

I got it working with this:
Code:
namespace XLite\Module\ZZZTEST\ZtestRemoveCss; /** * * @Decorator\Depend({"CDev\SimpleCMS"}), */ class Top extends \XLite\View\Menu\Customer\Top implements \XLite\Base\IDecorator { /** * Return the CSS files for the menu * * @return array */ public function getCSSFiles() { $list = parent::getCSSFiles(); foreach ($list as $key => $css_file) { if ($css_file == 'modules/CDev/SimpleCMS/css/primary_menu.css') { unset($list[$key]); } } return $list; } }


You can see it working before and after in the debug
Code:
[15:32:28.000000] array ( 0 => array ( 'file' => 'css/style.less', 'media' => 'screen', 'merge' => 'bootstrap/css/bootstrap.less', ), 1 => 'modules/CDev/SocialLogin/style.css', 2 => 'modules/CDev/Sale/css/lc.css', 3 => 'modules/CDev/Paypal/style.css', 4 => array ( 'file' => 'modules/CDev/Paypal/style.less', 'media' => 'screen', 'merge' => 'bootstrap/css/bootstrap.less', ), 5 => 'modules/CDev/SimpleCMS/css/primary_menu.css', ) Runtime id: fca9e552e9db6c00b881ade23b2ba653 SAPI: fpm-fcgi; IP: 213.143.60.121 URI: /x53-upgrade-test1/x835-pk.html Method: GET [15:32:28.000000] array ( 0 => array ( 'file' => 'css/style.less', 'media' => 'screen', 'merge' => 'bootstrap/css/bootstrap.less', ), 1 => 'modules/CDev/SocialLogin/style.css', 2 => 'modules/CDev/Sale/css/lc.css', 3 => 'modules/CDev/Paypal/style.css', 4 => array ( 'file' => 'modules/CDev/Paypal/style.less', 'media' => 'screen', 'merge' => 'bootstrap/css/bootstrap.less', ), )

It's always a problem for me working what and how to override methods but at least it's working now.
__________________
Core version: 5.5.xx
Reply With Quote