模块未显示在Joomla页面上(常规菜单项)


Module not showing on Joomla page (regular menu item)

我有一个Joomla模板,它在我的一个页面上没有显示模块。模块已发布并分配给常规发布的菜单项。

经过一些研究,我发现问题可能是由于模板覆盖造成的。 这是我的模块.php文件...这里是否有任何内容会导致模块不显示在特定页面上?

谢谢

<?php
defined('_JEXEC') or die;
function modChrome_themeHtml5($module, &$params, &$attribs) {
    $moduleTag      = $params->get('module_tag');
    $headerTag      = htmlspecialchars($params->get('header_tag'));
    $headerClass    = $params->get('header_class');
    $bootstrapSize  = $params->get('bootstrap_size');
    $moduleClass    = !empty($bootstrapSize) ? ' span' . (int) $bootstrapSize . '' : '';
    $moduleClassSfx = htmlspecialchars($params->get('moduleclass_sfx'));
    if (!empty ($module->content)){
        $html  = "<{$moduleTag} class='"moduletable {$moduleClassSfx} {$moduleClass}'">";
        if ((bool) $module->showtitle){
          $html .= "<{$headerTag} class='"moduleTitle {$headerClass}'">{$module->title}     </{$headerTag}>";
        }
        $html .= $module->content;
        $html .= "</{$moduleTag}>";
        echo $html;
    }
}

function modChrome_html5nosize($module, &$params, &$attribs){
    $moduleTag      = $params->get('module_tag');
    $headerTag      = htmlspecialchars($params->get('header_tag'));
    $headerClass    = $params->get('header_class');
    $bootstrapSize  = $params->get('bootstrap_size');
  //$moduleClass    = !empty($bootstrapSize) ? ' span' . (int) $bootstrapSize . '' : '';
    $moduleClassSfx = htmlspecialchars($params->get('moduleclass_sfx'));
    if (!empty ($module->content)){
        $html  = "<{$moduleTag} class='"moduletable {$moduleClassSfx}'">";
        if ((bool) $module->showtitle){
          $html .= "<{$headerTag} class='"moduleTitle {$headerClass}'">{$module->title}</{$headerTag}>";
        }
        $html .= $module->content;
        $html .= "</{$moduleTag}>";
        echo $html;
    }
}

function modChrome_modal($module, &$params, &$attribs){
    $moduleTag      = $params->get('module_tag');
    $headerTag      = htmlspecialchars($params->get('header_tag'));
    $headerClass    = $params->get('header_class');
    $bootstrapSize  = $params->get('bootstrap_size');
    // $moduleClass    = !empty($bootstrapSize) ? ' span' . (int) $bootstrapSize . '' : '';
    $moduleClassSfx = htmlspecialchars($params->get('moduleclass_sfx'));
    if (!empty ($module->content)){
        $html = "<div class='"modal fade moduletable {$moduleClassSfx} loginPopup'" id='"modal'">";
        $html .= "<button type='"button'" class='"close modalClose'">×</button>";
        if ((bool) $module->showtitle){
            $html .= "<div class='"modal-header'">";
            $html .= "<{$headerTag} class='"{$headerClass}'">{$module->title}</{$headerTag}>";
            $html .= "</div>";
        }
        $html .= "<div class='"modal-body'">";
        $html .= $module->content;
        $html .= "</div>";
        $html .= "</{$moduleTag}>";
        echo $html;
    }
}
可能是

如果(!empty ($module->content))

仅通过查看代码,我们无法确定。尝试通过逐部分注释掉函数中的代码来自己调试它,并查看问题来自哪个函数。这是最简单,最快的方法。