1

ページの 1 つにモジュールが表示されない 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;
    }
}
4

1 に答える 1

2

そうかもしれません(!empty ($module->content))

コードを見ただけでは確信が持てません。関数内のコードを部分的にコメントアウトして自分でデバッグしてみて、問題が発生している関数を確認してください。それが最も簡単で最速の方法です。

于 2013-09-30T14:18:55.337 に答える