简体   繁体   English

Joomla 3:带有Chrome的自定义模块样式

[英]Joomla 3: custom module style with chrome

I'm trying to set custom style for Joomla module. 我正在尝试为Joomla模块设置自定义样式。 I have created file modules.php in /templates/MY_TEMPLATE_NAME/html directory. 我已经在/ templates / MY_TEMPLATE_NAME / html目录中创建了modules.php文件。 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? 我错过了什么?

您需要转到扩展->模块管理器,选择要应用自定义样式的模块,在“高级”选项卡中,有一个选项“模块样式”,在模板名称下应有“自定义”选项,将其作为样式

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM