3

I'm trying to set custom style for Joomla module. I have created the file:

modules.php in /templates/MY_TEMPLATE_NAME/html directory.

Content of this file below:

defined('_JEXEC') or die;

function modChrome_custom($module, &$params, &$attribs)
{
     echo '<h3>test style chrome</h3>';
}

Now, I try to output module from my template with this style. I do it this way:

 <jdoc:include type="modules" name="position-1" style="custom"  />

But it looks like my custom style is not applying to the module and all I see is a standard module layout. Did I miss something?

  • 1
    Your code looks ok and should be working properly. I even tested it on my local protostar and it works as it should – webchun Dec 1 '14 at 5:45
  • Are you sure you have named the file modules.php and not module.php (note the s on the end). Try using a different name for the chrome as custom might already be taken – Lodder Dec 1 '14 at 11:22
4

if you change the style of your module in the backend it will overwrite the style given to your jdoc:include in the index.php.

Go to your Backend->Modules, open Modul, open last Tab "Advanced", scroll down to last item "Module Style", check wich style is associated to your module.

To use the style added to your jdoc:include you need to set the backend style to "From Template: Inherited".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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