Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • spacedefender Friend
    #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 Friend
    #361164

    Try this extension, it has more option to operate with site’s title. Also, the same tasks are done by this and this plugins.

    spacedefender Friend
    #361166

    Thank you very much, Gray! But is there any way to change title without installing any plugins. Older templates have this ability.

    gray Friend
    #361173

    I 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!

    spacedefender Friend
    #361210

    Thank 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]

    gray Friend
    #361215

    Ok, you just wanted to add a constant “My Site”.
    My code above is adding site name from configs.

Viewing 6 posts - 1 through 6 (of 6 total)

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