Greetings

Thanks for great the great module. I was wondering if you had considered applying individual classes for every li. I notice it automatically applies first and last classes, but I think there's some utility to being able to theme every individual li.

Thanks for your time and consideration.

Comments

Mark Theunissen’s picture

Hi jimi089

You can use Drupal's theme layer to change any part of the slider. Just create a themename_preprocess_slider() function in your template.php. Then you will probably want to override the $vars['tabs_formatted'] variable. Change this line:

$vars['tabs_formatted'] = theme('item_list', $vars['tabs'], NULL, 'ul', array('class' => 'slidenav'));

As you can see, at the moment it uses the base theme_item_list to create the list. You can substitute this for anything you like really, as long as it meets the basic requirements of being a list with the class "slidenav".

Hope that helps
Mark

notarealperson’s picture

Thanks very much for your help and guidance!

Mark Theunissen’s picture

Status: Active » Closed (fixed)

No problem. Here's the handbook page in case you want some more guidance...

http://drupal.org/node/223430

asak’s picture

I still don't get it.

I'de like to get a unique ID/class for every li - so that i could theme them seperatly.

How could the solution mentioned help with this...? :-/

Thanks!

Mark Theunissen’s picture

Status: Closed (fixed) » Active

Well, instead of returning a theme('item_list'), you'd write your own function that gives each li it's own class. Or you'd make a new array out of vars['tabs'] with class attributes.

http://api.drupal.org/api/function/theme_item_list

If I have time, I will see if I can do this, but it's unlikely to be done in the near future. Will keep this thread updated.

Mark Theunissen’s picture

Status: Active » Fixed

Fixed in 6.x-1.2 by adding the following to the preprocess function:

    $vars['tabs'][] = array(
      'data' => l($slide_title, $link, $slide_options),
      'class' => 'tabtitle-' . $vars['node']->nid . '-' . $slide_node->nid,
    );

Status: Fixed » Closed (fixed)

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