How to add extra text to the <title> tag in Joomla

雨燕双飞 提交于 2020-01-04 09:17:13

问题


I need to add extra text (Hard cord) to the title tag on a joomla website. But I cant seem to find where the tag is located in Joomla. Does any of you guys know where it is located? hanks


回答1:


Try adding this to your pages

<?php 
if (@$_REQUEST['view'] != 'frontpage') {
$document =& JFactory::getDocument();
$document->setTitle("My Custom Text - ".$document->getTitle());
}
?>

or

<?php 
if (@$_REQUEST['view'] != 'frontpage') {
$document =& JFactory::getDocument();
$document->setTitle($document->getTitle() . " - My Custom Text");
}
?>

or

<?php 
if (@$_REQUEST['view'] != 'frontpage') {
$document =& JFactory::getDocument();
$document->setTitle("My Custom Text");
}
?>

if your looking for something less dynamic that resembles a setting in joomla then go into your site menu, under global I think, its been a while since ive used joomla and some where within there there should be a box to type a unique title in that will be on all pages.




回答2:


In the Joomla administrator backend, go to edit a menu item and on the right hand side, there is a tab called "Page Display Options". Then you can type in the title of your choice in the "Browser Page Title" input field.



来源:https://stackoverflow.com/questions/11731912/how-to-add-extra-text-to-the-title-tag-in-joomla

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!