X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   custom css in admin area? (https://forum.x-cart.com/showthread.php?t=72182)

cvaughan02 05-28-2015 07:22 AM

custom css in admin area?
 
hey guys, anybody know how to add custom css to the admin area?

tony_sologubov 05-29-2015 04:50 AM

Re: custom css in admin area?
 
Here is the general article about adding CSS files:
http://kb.x-cart.com/display/XDD/Adding+CSS+and+JS+files

You can add a condition for admin area in the getThemeFiles() method:
PHP Code:

if (!is_null($adminZone)) 


cvaughan02 05-29-2015 06:03 AM

Re: custom css in admin area?
 
Quote:

Originally Posted by tony_sologubov
Here is the general article about adding CSS files:
http://kb.x-cart.com/display/XDD/Adding+CSS+and+JS+files

You can add a condition for admin area in the getThemeFiles() method:
PHP Code:

if (!is_null($adminZone)) 



that implies that without that, all the files would get added on the admin, right? my issue is that i'm not seeing my css files being added o the admin side, so i'm wondering if that method actually gets called in the admin panel.

this morning I found this in AdminPanel.php

PHP Code:

/**
     * Register CSS files
     *
     * @return array
     */
    
public function getCSSFiles()
    {
        
$list parent::getCSSFiles();

        
$list[] = 'css/admin_panel.css';

        return 
$list;
    } 


so I'm thinking maybe I can extend that to add my admin panel css.

but if you're saying that the getthemfiles() method of aview gets called in the admin area, then I dont need to do that. can you clarify?

cvaughan02 06-02-2015 06:27 AM

Re: custom css in admin area?
 
Quote:

Originally Posted by tony_sologubov
Here is the general article about adding CSS files:
http://kb.x-cart.com/display/XDD/Adding+CSS+and+JS+files

You can add a condition for admin area in the getThemeFiles() method:
PHP Code:

if (!is_null($adminZone)) 



:::Solved:::

Ok, so I fugured out the issue. In order for the css to show up in the admin area, you have to add it to skins/admin/en/modules/devid/modid/.

as I'm learning over and over, where I place my code is just as integral as the code itself.


All times are GMT -8. The time now is 06:37 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.