Create a hook that registers all available jCarousel skins into a registry so that when adding a jCarousel element to the page with a custom skin, you don't always have to pass the skin path.
/**
* Implementation of hook_jcarousel_skins().
*/
function jcarousel_jcarousel_skins() {
$skins = array();
$skins['ie7'] = array(
'css' => drupal_get_path('module', 'jcarousel') . '/jcarousel/skins/ie7/ie7.css',
'name' => t('IE7'),
);
$skins['tango'] = array(
'css' => drupal_get_path('module', 'jcarousel') . '/jcarousel/skins/tango/tango.css',
'name' => t('Tango'),
);
return $skins;
}
This should be cached both in static cache and cache_set/get appropriately. The skin registry would be returned by calling jcarousel_skins(). Anyway to implement hook_jcarousel_skins() in a theme?
Comments
Comment #1
wim leersThemes can't implement hooks I think? Just write a tiny module for it when you need it.
Thanks for your continued contributions to this module! :)
Comment #2
mfer commentedI would add a custom option that adds no css and a description that this is for themes.
Comment #3
quicksketchThis is implemented in the 2.x branch of the module. See the implementation the jcarousel.module includes for itself in jcarousel_jcarousel_skin_info(). The dev release is currently at http://drupal.org/node/982718, I hope to be creating a more official release shortly.
Comment #5
ndmaque commentedhow to create a custom skin for jcarousel v 6.x-1.0
great module, thanks
create a small module (in my case as_jcarousel)
create a folder inside (skins in my case)
and point to the css file relative from your module (do not use full paths like in the example above)