I wanted to be able to enter a new skin name, instead of just using the built-in tango skin, so I patched the module to allow this. Leaving the field empty removes the skin and leaves a nice, clean layout that uses the imagecache thumbnail preset. See the attached patches. Works well on my setup: Drupal 6.13 with jCarousel 6.x-1.1.

I actually also wanted to put it in an option for setting the autoscroll delay. But for some reason jCarousel ignored the setting completely (I did add the option to the integer check function to ensure it came out an integer), so I removed that from this patch.

Comments

Mark Theunissen’s picture

As far as I'm aware, you can just change the Skin in the jCarousel admin screen. Why do you need to patch Galleria for this?

davemybes’s picture

I didn't find any admin screen for jCarousel, actually. Looking through the module's code, there are no actual admin settings. However, there might be some when using the jQ module with jCarousel. *edit* actually, there aren't any there either.

That said, I thought it might also be nice to be able to use a different skin for a Galleria.

However, if you feel its not needed, no worries. Having this post here will at the very least give me an easy place to find the patch again if I want it in the future :)

ndwilliams3’s picture

I was also trying to do this and could not find an admin option for jcarousel. I implemented your patch, Works Great! but also added a couple lines to declare the skin_path variable, so that the skin can be put in your theme folder. Sorry, I don't do much coding, so I don't have the ability to create a patch file.

galleria.admin.inc

	   $form['galleria_jcarousel']['galleria_jcarousel_skin_path'] = array(
      '#type' => 'textfield',
      '#title' => t('Skin Path'),
      '#size' => 90,
      '#default_value' => variable_get('galleria_jcarousel_skin_path', 'NULL'),
      '#description' => t('Enter the relative path to the skin.css file in the skin folder within your Theme folder to use e.g. tango or ie7 (included with jCarousel). Leave empty for basic styling, which uses the imagecache thumbnail preset selected above.'),
    );

galleria.module

    $skin_path = variable_get('galleria_jcarousel_skin_path', 'NULL');
    jcarousel_add('.gallery', $options, $skin, $skin_path);
dsp1’s picture

where is the admin menu item?

SkullSplitter09’s picture

Status: Needs review » Reviewed & tested by the community

thanks a lot :)

works very fine :)

Pierco’s picture

You can also add a dropdown to select the skin name:

galleria.admin.inc

$jcarousel_path = drupal_get_path('module', 'jCarousel') . '/jcarousel/skins';
// it's certainly better to use 'file_scan_directory' to parse directory
$hdl = opendir($jcarousel_path);
while(false !== ($file = readdir($hdl))) {
	if ( $file != '.' && $file != '..' ) $skins[$file] = $file;
}
closedir($hdl);
$form['galleria_jcarousel']['galleria_jcarousel_skin'] = array(
  '#type' => 'select',
  '#title' => t('Skin'),
  '#options' => $skins,
  '#default_value' => variable_get('galleria_jcarousel_skin', current($skins)),
  '#description' => t('Place your skins in jcarousel/jcarousel/skins.'),
);

galleria.module

 jcarousel_add('.gallery', $options, variable_get('galleria_jcarousel_skin'));

jcarousel.module

 if ($skin == 'tango' || $skin == 'ie7' || $skin == 'your_skin_name') {
aww’s picture

Thank you for improving this great module.

galleria.module

should be => jcarousel_add('.gallery', $options, variable_get('galleria_jcarousel_skin','NULL'));

macmladen’s picture

I managed to figure out where to add first two in galleria module, but I have no clue where to add this line in jCarousel module?

youlikeicecream’s picture

Works like a charm for me. Although I made this change to jcarousel.module

if ($skin == 'tango' || $skin == 'ie7' || $skin == variable_get('galleria_jcarousel_skin','tango')) {