2

I am having an issue loading my custom icons for the Fivestar module; Here are the steps I am taking, I am hoping someone can point out what I am missing.

first I hook into the fivestar widget to add in my new theme.

function my_module_fivestar_widgets() {
  $module_path = drupal_get_path('module', 'my_module');
  $widgets = array(
    $module_path . '/images/bonestars/bonestar.css' => 'bone_stars',
  );

   return $widgets;
}

This bonestar.css is pretty much a complete copy of the basic theme. Inside the css I link to my images instead of basic, so everything so far seems safe.

Next I go to the views configuration and click under Fields, Field: Rating. I click the SHOWSTAR DISPLAY OPTIONS to select which star I want to use. I see my custom stars visually:

my custom star image

I select it and save it and apply to all.

So then I go to my view to check if the new star theme has been loaded, but it now loads basic. So I clear the cache as well, nothing.

I am obviously loading the images or something, but it doesn't translate to my view. What am I missing? I also test this on views, blocks, etc it never loads it on the actual site. Only in the settings as seen above.

  • Views has its own cache. After you saved the field, did you save the view? If not, save the view, then clear your caches. – Triskelion Mar 7 '13 at 17:53
  • I did clear the view cache (So I clear the cache as well, nothing.) but both. – John Riselvato Mar 7 '13 at 18:17
0

There are generally 2 themes used in Drupal:

  • Main theme
  • Administrative theme

On the view configuration page, the administrative theme and its css will be loaded. On the output page of the view (if it is not an administrative page as well) the main theme and its css will be loaded.

That means, you have to update your css in both administrative and main theme.

0

When I added my custom fivestar, I saw a similar issue, you do not have your CSS listed but check to see if in the css you copied, check to see if all instances of the .fivestar- class has your custom star name after the hyphen. i.e. .fivestar-bone_stars Also of note, I answered this on another person's post here is a really nice tutorial on adding custom stars using file_scan_directory so that all you have to do is add a new folder and update the css and the hook will automatically pick it up.

Custom fivestar widget does not display custom icons

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.