I have a Problem with the carousel module from bootstrapjoomla.com Unfortunately the module doesn't support alternative layouts. But I need to have two carousel on my homepage. Therefore I've to create an override for the carousel where I change the carousel-id.

I tried to create an html-override depending on the moduleclass suffix but it doesn't work. The moduleclass suffix of my second carousel is " Carousel-carousel2". The code I inserted in the default.php in the override:

defined('_JEXEC') or die;
/* Layout anhand einer CSS-Klasse im Modul umleiten */

if(preg_match('/\Carousel-([A-Za-z]+)/', $module->moduleclass_sfx , $matches)){
  $this->setLayout($matches[1]);#ist Layout carousel2
   echo $this->loadTemplate('default'); #carousel2_default.php wird aufgerufen


} ?> 

carousel2_default.php is the file with my override.

My problem is, that the second carousel doesn't use the override but uses the default.php.

  • I solved the problem with insertign an field in the module woth the parameter "modulecarousel_id" and reinstalled it so now I can give each carousel it's own id.
    – lukasg
    Commented Jun 22, 2015 at 12:48
  • 1
    Please write this as a proper answer below and mark it as "accepted" so people can easily see it has been solved ;)
    – Lodder
    Commented Jun 22, 2015 at 16:03

1 Answer 1


You can easily add the advanced module options that allow alternative layouts, by creating an override of the modules .xml and adding the advanced fields options within the <fields name="params"> tags, like this:

    <fields name="params">
        <fieldset name="advanced">
                description="JFIELD_ALT_MODULE_LAYOUT_DESC" />
                description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" />

This adds the options for alternative layouts and custom module class suffix to the module settings, under the advanced tab, so you can select your alternative layout.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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