简体   繁体   English

Joomla 3.36-浏览器页面标题

[英]Joomla 3.36 - Browser Page title

Hi I go to menu page display and enter text into the Browser Page title field but 嗨,我进入菜单页面显示,然后在“浏览器页面”标题字段中输入文本,但是

It does not change the browser page title. 它不会更改浏览器页面标题。

Does anyone have any ideas what could create this issue? 有谁知道会导致这个问题的原因吗?

I've had this situation occur most frequently with 3rd party components. 我遇到这种情况时,最常见的是第三方组件。 Joomla stores these values when you specify them in the menu item, but it's up to the component whether or not they're used. 当您在菜单项中指定这些值时,Joomla会存储这些值,但是否使用它们取决于组件。 Below is the code I've added to the template overrides. 以下是我添加到模板替代中的代码。 If you don't know how to override template output, you should read How to override the output from the Joomla! 如果您不知道如何覆盖模板输出,则应阅读如何覆盖Joomla的输出! core first. 核心第一。

Put this code before any other HTML code in the template override file. 将此代码放在模板替代文件中的任何其他HTML代码之前。 It checks to see if you've specified to show the page headings or not, and if so, it will use that, otherwise it will use whatever the menu title is. 它会检查您是否已指定显示页面标题,如果显示,将使用该页面标题,否则将使用任何菜单标题。

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

To see how Joomla does it by default, look at components\\com_content\\views\\article\\tmpl\\default.php 要查看默认情况下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;

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

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