<i id='WWfm7'><tr id='WWfm7'><dt id='WWfm7'><q id='WWfm7'><span id='WWfm7'><b id='WWfm7'><form id='WWfm7'><ins id='WWfm7'></ins><ul id='WWfm7'></ul><sub id='WWfm7'></sub></form><legend id='WWfm7'></legend><bdo id='WWfm7'><pre id='WWfm7'><center id='WWfm7'></center></pre></bdo></b><th id='WWfm7'></th></span></q></dt></tr></i><div id='WWfm7'><tfoot id='WWfm7'></tfoot><dl id='WWfm7'><fieldset id='WWfm7'></fieldset></dl></div>
    1. <legend id='WWfm7'><style id='WWfm7'><dir id='WWfm7'><q id='WWfm7'></q></dir></style></legend>
        <bdo id='WWfm7'></bdo><ul id='WWfm7'></ul>

      <small id='WWfm7'></small><noframes id='WWfm7'>

      <tfoot id='WWfm7'></tfoot>

        菜单项标题覆盖模块中的 setTitle

        时间:2023-10-16

        <small id='NRVFZ'></small><noframes id='NRVFZ'>

          <tbody id='NRVFZ'></tbody>

        1. <legend id='NRVFZ'><style id='NRVFZ'><dir id='NRVFZ'><q id='NRVFZ'></q></dir></style></legend>
            <bdo id='NRVFZ'></bdo><ul id='NRVFZ'></ul>

            <i id='NRVFZ'><tr id='NRVFZ'><dt id='NRVFZ'><q id='NRVFZ'><span id='NRVFZ'><b id='NRVFZ'><form id='NRVFZ'><ins id='NRVFZ'></ins><ul id='NRVFZ'></ul><sub id='NRVFZ'></sub></form><legend id='NRVFZ'></legend><bdo id='NRVFZ'><pre id='NRVFZ'><center id='NRVFZ'></center></pre></bdo></b><th id='NRVFZ'></th></span></q></dt></tr></i><div id='NRVFZ'><tfoot id='NRVFZ'></tfoot><dl id='NRVFZ'><fieldset id='NRVFZ'></fieldset></dl></div>

                  <tfoot id='NRVFZ'></tfoot>

                  本文介绍了菜单项标题覆盖模块中的 setTitle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我遇到过在菜单管理器中 Joomla 后端指定的菜单项标题覆盖以下调用的情况:JFactory::getDocument()->setTitle('Custom title')

                  I've encountered a scenario where the menu item Title specified on the Joomla back-end in Menu Manager overrides the following call: JFactory::getDocument()->setTitle('Custom title')

                  文档的标题变为自定义标题",直到 components/com_content/views/article/view.html.php 中的以下几行:

                  The document's title becomes 'Custom title' up until the following lines in components/com_content/views/article/view.html.php:

                  if (empty($title)) {
                      $title = $this->item->title;
                  }
                  $this->document->setTitle($title);
                  

                  我为模块中的文档指定了一个新标题:

                  I assign a new title to the document in my module:

                  JFactory::getDocument()->setTitle('New title');
                  

                  如何阻止 Joomla 覆盖我在模块中提供给文档的文章?

                  How can I stop Joomla from overwriting the article I gave the document in my module?

                  推荐答案

                  You Can Use Javascript from your module:

                  You Can Use Javascript from your module:

                  如果此代码对您有帮助,请注意我:)

                  Note me Please If This Code Helps you :)

                  JFactory::getDocument()->addScriptDeclaration("     
                          window.onload=function(){
                            changeTitle('New Title')
                          }
                  
                          function changeTitle(newTitle){
                              document.title=newTitle;            
                          }       
                      ");
                  

                  这篇关于菜单项标题覆盖模块中的 setTitle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                1. <i id='dUg5T'><tr id='dUg5T'><dt id='dUg5T'><q id='dUg5T'><span id='dUg5T'><b id='dUg5T'><form id='dUg5T'><ins id='dUg5T'></ins><ul id='dUg5T'></ul><sub id='dUg5T'></sub></form><legend id='dUg5T'></legend><bdo id='dUg5T'><pre id='dUg5T'><center id='dUg5T'></center></pre></bdo></b><th id='dUg5T'></th></span></q></dt></tr></i><div id='dUg5T'><tfoot id='dUg5T'></tfoot><dl id='dUg5T'><fieldset id='dUg5T'></fieldset></dl></div>
                    <bdo id='dUg5T'></bdo><ul id='dUg5T'></ul>

                        <small id='dUg5T'></small><noframes id='dUg5T'>

                        <legend id='dUg5T'><style id='dUg5T'><dir id='dUg5T'><q id='dUg5T'></q></dir></style></legend>
                          <tbody id='dUg5T'></tbody>

                        <tfoot id='dUg5T'></tfoot>