2013-02-16 106 views
0

我有這個網站,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

你的代碼在哪裏? – Ramin 2013-02-16 19:39:50

+0

您正在爲所有頁面使用模板? – 2013-02-16 19:40:41

回答

1

由於您使用Joomla 1.5,登錄到你的後臺,發現主頁菜單項(帶有星號),並在它的屬性在右側頁面標題

+0

什麼在談論?頁面標題用於文章的標題,而不是網頁....您在網頁瀏覽器頂部知道,標題標籤爲html – 2013-02-16 20:27:59

+0

菜單設置(在菜單管理器中)下的頁面標題正好用於標題標籤在HTML中,不是用於文章的標題。除非你的模板是用非常不規範的方式編寫的,當然... – 2013-02-16 20:34:23

+0

哦,誤解我的部分.....是的,它的工作!猜猜我應該關閉這個線程....謝謝Marko D – 2013-02-16 20:45:51

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> 
+0

因此,我將該腳本添加到標記或什麼? – 2013-02-16 19:51:46

相關問題