2014-12-04 66 views
0

嗨我去菜單頁面顯示並輸入文本到瀏覽器頁面標題字段,但Joomla 3.36 - 瀏覽器頁面標題

它不會更改瀏覽器頁面標題。

有沒有人有任何想法可以造成這個問題?

+0

請在[堆棧的Joomla交易所]在問你的問題(http://joomla.stackexchange.com) – Lodder 2014-12-04 16:51:52

回答

0

我有這種情況最頻繁發生與第三方組件。當您在菜單項中指定它們時,Joomla會存儲這些值,但無論它們是否被使用,它都取決於組件。以下是我添加到模板覆蓋的代碼。如果您不知道如何覆蓋模板輸出,則應首先閱讀How to override the output from the Joomla! core

將此代碼放在模板覆蓋文件中的任何其他HTML代碼之前。它會檢查是否指定顯示頁面標題,如果是,則會使用該標題,否則將使用菜單標題。

<?php if ($this->params->get('show_page_heading',1)) : ?> 
    <h1><?php echo $this->params->get('page_heading') ? $this->params->get('page_heading') : JFactory::getApplication()->getMenu()->getActive()->title; ?></h1> 
<?php endif; ?> 

要查看默認的Joomla是怎麼做的,看看components\com_content\views\article\tmpl\default.php

<div class="item-page<?php echo $this->pageclass_sfx?>"> 
    <?php if ($this->params->get('show_page_heading', 1)) : ?> 
    <div class="page-header"> 
     <h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1> 
    </div> 
    <?php endif; 
+0

謝謝您的幫助。原來,這是一個模板插件,造成了這個問題。 – TRLUK 2015-07-04 15:09:34