Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • mediamente Friend
    #172850

    Hi all!
    I’m creating a website where the user is able to switch between 2 and more joomlart templates directly from the front-end.
    The main problem is that the JA Slideshow module doesn’t switch to the appropriate skin profile.
    The dirty solution is to describe the slideshow style inside the template css.
    I think that the smarter and more elegant solution would be to have the module that automatically switch to the correct skin.
    Would it be realizable?

    mediamente Friend
    #434027

    After one hour of work I’ve found the solution.
    Let’s see the code of mod_jaslideshow.php starting from line 119:
    [PHP]if (!defined(‘_MODE_JASLIDESHOW2_ASSETS_’)) {
    define(‘_MODE_JASLIDESHOW2_ASSETS_’, 1);
    JHTML::stylesheet(‘modules/’ . $module->module . ‘/assets/themes/default/style.css’);
    if (!empty($skin)) {
    JHTML::stylesheet(‘modules/’ . $module->module . ‘/assets/themes/’ . $skin . ‘/style.css’);
    JHTML::stylesheet(‘modules/’ . $module->module . ‘/assets/themes/’ . $skin . ‘/’ . $module->module . “.css”);
    }

    if (is_file(JPATH_SITE . DS . ‘templates’ . DS . $mainframe->getTemplate() . DS . ‘css’ . DS . $module->module . “.css”))
    JHTML::stylesheet(‘templates/’ . $mainframe->getTemplate() . ‘/css/’ . $module->module . “.css”);

    JHTML::script(‘modules/’ . $module->module . ‘/assets/script.js’);
    }[/PHP]

    So, if the $skin is empty we can use the skin assigned to the template currently in use. The new code is the following:
    [PHP]if (!defined(‘_MODE_JASLIDESHOW2_ASSETS_’)) {
    define(‘_MODE_JASLIDESHOW2_ASSETS_’, 1);
    JHTML::stylesheet(‘modules/’ . $module->module . ‘/assets/themes/default/style.css’);
    if (!empty($skin)) {
    JHTML::stylesheet(‘modules/’ . $module->module . ‘/assets/themes/’ . $skin . ‘/style.css’);
    JHTML::stylesheet(‘modules/’ . $module->module . ‘/assets/themes/’ . $skin . ‘/’ . $module->module . “.css”);
    }
    else {
    JHTML::stylesheet(‘modules/’ . $module->module . ‘/assets/themes/’ . substr($mainframe->getTemplate(),3) . ‘/style.css’);
    JHTML::stylesheet(‘modules/’ . $module->module . ‘/assets/themes/’ . substr($mainframe->getTemplate(),3) . ‘/’ . $module->module . “.css”);
    }

    if (is_file(JPATH_SITE . DS . ‘templates’ . DS . $mainframe->getTemplate() . DS . ‘css’ . DS . $module->module . “.css”))
    JHTML::stylesheet(‘templates/’ . $mainframe->getTemplate() . ‘/css/’ . $module->module . “.css”);

    JHTML::script(‘modules/’ . $module->module . ‘/assets/script.js’);
    }[/PHP]

    Then It’s sufficient to set the skin parameter to “default” and the slideshow style will change according to the template in use.
    I think that this modify can be implemented in future releases. Let me know! 🙂

Viewing 2 posts - 1 through 2 (of 2 total)

This topic contains 2 replies, has 1 voice, and was last updated by  mediamente 12 years, 9 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum