繁体   English   中英

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

[英]Module not showing on Joomla page (regular menu item)

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

经过一些研究,我发现问题可能是由于模板覆盖。 这是我的module.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))

仅看代码就不能确定。 尝试通过逐个注释功能内部的代码来自己进行调试,然后查看是哪个功能发生问题。 这是最简单,最快的方法。

暂无
暂无

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

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