简体   繁体   English

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

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

I have a Joomla template that does not show a module on one of my pages. 我有一个Joomla模板,该模板在我的页面之一上未显示模块。 The module is published and is assigned to a regular published menu item. 该模块已发布并分配给常规发布的菜单项。

After doing some research I found that the issue may be due to template overides. 经过一些研究,我发现问题可能是由于模板覆盖。 Here is my module.php file...is there anything in here that would cause a module not to show on a particular page? 这是我的module.php文件...这里是否有任何东西会导致模块无法在特定页面上显示?

Thanks, 谢谢,

<?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;
    }
}

It might be if (!empty ($module->content)) 可能是(!empty ($module->content))

We can't be so sure from just looking at the code. 仅看代码就不能确定。 Try debugging it yourself by commenting out the code inside functions part by part, and see from which function the problem is occurring. 尝试通过逐个注释功能内部的代码来自己进行调试,然后查看是哪个功能发生问题。 That's the easiest and fastest way. 这是最简单,最快的方法。

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

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