Omar Mukhtar
Omar Mukhtar

Reputation: 3

How to make a separate Title for Home page? (title tag)

I have this site, with index.php incorporated with html, and I need to have separate title(the title tag) for only the home page, but whenever I add Home Page name to the index.php page, it changes all the pages on the site to that name. I am using Joomla 1.5...

Here's the code part:

<head>

<title> Home Page Title </title>

<jdoc:include type="head" />

<?php JHTML::_('behavior.mootools'); ?>

<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/template.css" type="text/css" />

<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/menu.css" type="text/css" />

<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/style.css" type="text/css" />

<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/slideshow.css" type="text/css" />

<script language="javascript" type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/js/vns.script.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/js/mootools.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/js/toptool.js"></script>


<!--[if lte IE 6]>

<script type="text/javascript">

var siteurl = '<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/';



window.addEvent ('load', makeTransBG);

function makeTransBG() {

    fixIEPNG ($$('#toptools ul li a'), '', 'crop', 0, 0);

    fixIEPNG ($$('#nav_all ul.menu li ul'), '', 'scale', 0, 0);

    fixIEPNG($$('img'));



}

</script>

<style type="text/css">

#hd p.buttonheading {

    margin:8px 0;

}

#nav_all ul.menu ul a {

    width: 14.8em!important;

}



</style>

<![endif]-->





<style type="text/css">

body{

    font-size: <?php echo $vnsfont = $this->params->get ("vnsfont"); ?>px;

}

</style>



<?php if ($vnsshowcopyright = $this->params->get('showcopyright') == 'yes') { ?>

<style type="text/css">

#cpr{

    display:block;

}

</style>

<?php }else{ ?>

<style type="text/css">

#cpr{

    display:none;

}

</style>

<?php } ?>



<?php if ($vnsshowcomponent = $this->params->get('showcomponent') == 'yes') { ?>

<style type="text/css">

#component{

    display:block;

}

</style>

<?php }else{ ?>

<style type="text/css">

#component{

    display:none;

}

</style>

<?php } ?>

<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/sosdmenu.css" type="text/css" />

<?php if ($vnsmenu = $this->params->get('vnsmenu') == 'moo') { ?>

<script language="javascript" type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/js/vns.moomenu.js"></script>

<?php }else{ ?>

    <?php if ($vnsmenu = $this->params->get('vnsmenu') == 'css') { ?>

        <script language="javascript" type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/js/vns.cssmenu.js"></script>

    <?php }else{ ?>



    <? } ?>

<? } ?>



<?php if ($vnsmenu = $this->params->get('vnsmenu') == 'none') { ?>

<style type="text/css">

#nav_all{

    display: none;

}

</style>

<?php  }?>



<?php if ($this->countModules('left')==0)  : ?>

<style type="text/css">

#ccenter {

    width:716px;

}

</style>

<?php endif; ?>

<?php if ($this->countModules('right')==0)  : ?>

<style type="text/css">

#ccenter {

    width:734px;

}

</style>

<?php endif; ?>

<?php if (($this->countModules('right')==0)&&($this->countModules('left')==0))  : ?>

<style type="text/css">

#ccenter {

    width:935px;

}

</style>

<?php endif; ?>



</head>

Upvotes: 0

Views: 183

Answers (2)

Marko D
Marko D

Reputation: 7576

Since you are using Joomla 1.5, log to your backend, find home page menu item (the one with a star), and in it's properties on the right set Page title

Upvotes: 1

StackedFlow
StackedFlow

Reputation: 85

Why don't you create a script that does something like this:

<?php $pages = array( 'index', 'test' ); $thispage = basename($_SERVER['PHP_SELF'], ".php");
if(in_array($thispage,$page)) { $titles = array( 'index' => 'Home Page', 'test' => 'Test Page' ); $title_final = $titles[$thispage]; } else { $title_final = 'Unknown Page'; }
?>

Now for the page part:

<html><head><title><?php echo $title_final; ?></title></head><body>blablabla</body></html>

Upvotes: 0

Related Questions