问题
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