Hi,

I'm using the most recent beta of Nice Menus (7.x-2.0-beta2) with a fairly vanilla (at least at the moment!) Zen subtheme. When I try to configure the theme to point to my custom .css file, it doesn't recognize the .css. To be on the safe side, I browsed to that location and the .css appears as a text file, so I know the path is good. Likewise, if I go into the module and modify nice_menus_init() with my hard-coded path at the drupal_add_css function under the Add main CSS functionality section, it works fine. If you can tell me how the variable is stored between sessions, I can check for you and see if the form submit is doing the job its supposed to.

CommentFileSizeAuthor
#1 nice_menus.patch1.17 KBaustinmroczek

Comments

austinmroczek’s picture

StatusFileSize
new1.17 KB

I had a similar issue with a brand new Zen sub-theme. I created my own copy of nice_menus_default.css and named it nice_menus.css in my theme directory. However, once I configured Nice Menus to point to my new CSS file it was broken, even though I hadn't changed any CSS.

After a little testing I figured out that the sites/all/modules/nice_menus/nice_menus.css file was not included in the list of CSS files when my custom CSS file was configured, and only when I used the exact same filename of "nice_menus.css".

I think it has to do with the D7 API for drupal_add_css, which has changed from D6. http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_ad.... There are many new options that can be passed. When I passed a unique "basename" option for each CSS file, the problem was solved.

I changed lines 169-178 of nice_menu.module (patch attached)

  // Add main CSS functionality.
  drupal_add_css(drupal_get_path('module', 'nice_menus') . '/nice_menus.css', array('group' => CSS_DEFAULT, 'basename' => 'nice_menus.css'));
  // Add custom CSS layout if specified.
  if ($custom = variable_get('nice_menus_custom_css', '')) {
    drupal_add_css($custom, array('group' => CSS_DEFAULT, 'basename' => 'nice_menus_custom.css'));
  }
  // Fall back to default layout.
  else {
    drupal_add_css(drupal_get_path('module', 'nice_menus') . '/nice_menus_default.css', array('group' => CSS_DEFAULT, 'basename' => 'nice_menus_default.css'));
  }
vordude’s picture

Status: Active » Fixed

Committed with 0c6ceb5f8f7 Good Call, Thanks Loads!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.