我有这个网站,index.php与html合并,我需要为主页单独标题(标题标签),但每当我将主页名称添加到index.php页面时,它都会改变网站上该名称的所有页面。我正在使用Joomla 1.5 ......
这是代码部分:
<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>
答案 0 :(得分:1)
由于您使用的是Joomla 1.5,请登录后端,找到主页菜单项(带星号的菜单项),右侧设置页面标题中的属性
答案 1 :(得分:0)
为什么不创建一个类似这样的脚本:
<?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'; }
?>
现在是页面部分:
<html><head><title><?php echo $title_final; ?></title></head><body>blablabla</body></html>