08/10/2011
|13:04
在 Joomla 1.5, <title> 會由系統按照文章的名稱或 Menu 的名稱自動設定。
但是預設的<title> 裡卻不會包括網站的名稱。
e.g.
只顯示: <title>關於我們</title>
而不是: <title>關於我們 - 我的網站</title>
要加進 "網站名稱",步驟很簡單,只需把以下代碼加進使用 template 的 index.php 中。
e.g.
修改 templates/rhuk_milkyway/index.php
在 <jdoc:include type="head" />之前加進:
<?php $mydoc =& JFactory::getDocument();
$mytitle = $mydoc->getTitle();
$conf =& JFactory::getConfig();
$sitename = $conf->getValue('config.sitename'); //取得網站名稱
$mydoc->setTitle($mytitle.' - '.$sitename); ?>
| < 前一個 | 下一個 > |
|---|
