Custom advanced module css

edited April 2013 in Modules
Hello again,

I'm tidying up my custom module (for Flexicart) and want to use some of the Flexicart CSS in the Fuel-ised admin pages that I've created. Basically, they are not using the Fuel module class but are the cut down and edited examples provided in the Flexi cart demo, but with the Fuel nav, top blocks etc and general look and feel.

The module creation process has made a cart.css file which is included into the Fuel admin, but it is loaded across all pages, and some of the Flexi cart stuff clashes with Fuel styles. Rather than re-edit the Flexi cart HTML or classes, I thought I should be able to include the CSS only within the cart admin module. Is this possible?

On other ("simple") modules, I've used the controller.js to document write a to the css, but I can't see how to load that CartController.js in the advanced module? Again, the generation process has made the controller.js, but it is not present in the cart admin (maybe because I'm using Frankenstein admin pages?!)

I'm being lazy in not re-editing the original material, but nonetheless, I'd like to be able to load CSS and JS in the Fuel way.

Comments

  • edited 1:59PM
    OK,

    seek and ye shall find... I looked at the existing advanced modules, and found the Google Keywords one had a js controller loaded via $this->js_controller.

    However, trying to append a css file via javascript results in a 403.

    I'm now trying to load a $css value into the admin blocks, but the paths keep coming out wrong!
  • edited April 2013
    Right,

    this isn't as satisfactory as I'd like, because the css is now sourced from the general assets folder, not the module asset folder. I have this in my advanced module admin controller constructor:

    $this->data['css'] = array('cart_admin');

    and this gets loaded into each module view, but as intended, nowhere else.
  • edited 1:59PM
    Try an array like this where 'MY_MODULE' is your advanced module's name:
    array('MY_MODULE' => 'cart_admin');
  • edited 1:59PM
    Yes! Result! Thanks!
Sign In or Register to comment.