-
AuthorPosts
-
October 31, 2010 at 8:28 am #155906
Please help me to add site name to title tag. I can’t find <title> section in /plugins/system/jat3/base-themes/default/blocks/head.php
gray Friendgray
- Join date:
- October 2009
- Posts:
- 957
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 28
- Thanked:
- 292 times in 230 posts
October 31, 2010 at 9:26 am #361166Thank you very much, Gray! But is there any way to change title without installing any plugins. Older templates have this ability.
gray Friendgray
- Join date:
- October 2009
- Posts:
- 957
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 28
- Thanked:
- 292 times in 230 posts
October 31, 2010 at 11:59 am #361173I haven’t seen any templates which assign site’s title to every page. Maybe it really was long time ago with J1.0.x.
Actually this job is done by
<jdoc:include type=”head” />Quote from Joomla docs:
The first line gets Joomla to put the correct header information in. This includes the page title, meta information as well as system JavaScript.
Also I found a thread on Joomla forum.
Among others a suggestion was to inlcude in index.php
[php]$this->setTitle($mainframe->getCfg(‘sitename’) . ‘ – ‘ . $this->getTitle());[/php]I modified the code a little bit not to get double title on home page
[php]
$menu = & JSite::getMenu();
if ($menu->getActive() != $menu->getDefault()) {
$this->setTitle($this->getTitle() . ‘ [‘ . $mainframe->getCfg(‘sitename’) . ‘]’);
}
[/php]Just installed on my site justphp.net – works perfectly!
1 user says Thank You to gray for this useful post
October 31, 2010 at 9:16 pm #361210Thank you again for your help, Gray. I finally found where to do this dirty trick:
root/libraries/joomla/document/html/renderer/head.php
line 85
[PHP]$strHtml .= $tab.'<title>’.htmlspecialchars($document->getTitle()).'</title>’.$lnEnd;[/PHP]
So I change this line
[PHP]$strHtml .= $tab.'<title>My Site : : ‘.htmlspecialchars($document->getTitle()).'</title>’.$lnEnd;[/PHP] -
AuthorPosts
This topic contains 6 replies, has 2 voices, and was last updated by gray 14 years ago.
We moved to new unified forum. Please post all new support queries in our New Forum