February 19,2007

[翻譯]Joomla! 1.0.12版及較舊版本 樣板教學 6of9

原文: Hazman  
出處 : xtremeOpenSource

Joomla!程式碼 - 左方內容(Left Content)
這段程式碼 <?php mosLoadModules ( 'left' ); ?>呈現出左方內容,所以必須放在我們主要內容表格的左邊欄位。
複製到index.php檔案內。
<?php
/**
* @version - Template version goes here
* @package - Name of the template goes here
* @author - Author's name goes here
* @email - Your email goes here
* @website - Your website goes here
* @copyright (C) - Your copyright goes here
* @license - Type of license goes here
*/
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
// needed to seperate the ISO number from the language file constant _ISO
$iso = split( '=', _ISO );
// xml prolog
echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>'; ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<?php mosShowHead(); ?>
<?php if ( $my->id ) { initEditor(); } ?>
<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
<?php echo "<link rel=\"stylesheet\" href=\"$GLOBALS[mosConfig_live_site]/templates/$GLOBALS[cur_template]/css/template_css.css\" type=\"text/css\"/>" ; ?>
</head>

<body>

<div id="main_container">

<div id="header">
Header
</div>

<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">

<td width="150">
Left Column Content
<?php mosLoadModules ( 'left' ); ?>
</td>

<td width="100%">
Center Column Content
<?php mosPathWay(); ?>
</td>

<td width="150">
Right Column Content
</td>

</tr>
</table>

</div>

<div id="footer">
Footer
</div>

</div>

</body>
</html>


Joomla!程式碼- 主要內容(Main Body)
這個主要內容程式碼<?php mosMainBody(); ?> 呈現出主要內容或中間內容,必須放在主要內容表格的中間欄位,在 <?php mosPathWay(); ?>之下。
我們複製到index.php檔案裡。
<?php
/**
* @version - Template version goes here
* @package - Name of the template goes here
* @author - Author's name goes here
* @email - Your email goes here
* @website - Your website goes here
* @copyright (C) - Your copyright goes here
* @license - Type of license goes here
*/
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
// needed to seperate the ISO number from the language file constant _ISO
$iso = split( '=', _ISO );
// xml prolog
echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>'; ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<?php mosShowHead(); ?>
<?php if ( $my->id ) { initEditor(); } ?>
<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
<?php echo "<link rel=\"stylesheet\" href=\"$GLOBALS[mosConfig_live_site]/templates/$GLOBALS[cur_template]/css/template_css.css\" type=\"text/css\"/>" ; ?>
</head>

<body>

<div id="main_container">

<div id="header">
Header
</div>

<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">

<td width="150">
Left Column Content
<?php mosLoadModules ( 'left' ); ?>
</td>

<td width="100%">
Center Column Content
<?php mosPathWay(); ?>
<?php mosMainBody(); ?>
</td>

<td width="150">
Right Column Content
</td>

</tr>
</table>

</div>

<div id="footer">
Footer
</div>

</div>

</body>
</html>


Joomla!程式碼 -右方內容
這段程式碼<?php mosLoadModules ( 'right' ); ?>呈現右方內容,所以必須放在主要內容表格的右邊欄位。
複製到index.php檔案裡。
<?php
/**
* @version - Template version goes here
* @package - Name of the template goes here
* @author - Author's name goes here
* @email - Your email goes here
* @website - Your website goes here
* @copyright (C) - Your copyright goes here
* @license - Type of license goes here
*/
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
// needed to seperate the ISO number from the language file constant _ISO
$iso = split( '=', _ISO );
// xml prolog
echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>'; ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<?php mosShowHead(); ?>
<?php if ( $my->id ) { initEditor(); } ?>
<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
<?php echo "<link rel=\"stylesheet\" href=\"$GLOBALS[mosConfig_live_site]/templates/$GLOBALS[cur_template]/css/template_css.css\" type=\"text/css\"/>" ; ?>
</head>

<body>

<div id="main_container">

<div id="header">
Header
</div>

<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">

<td width="150">
Left Column Content
<?php mosLoadModules ( 'left' ); ?>
</td>

<td width="100%">
Center Column Content
<?php mosPathWay(); ?>
<?php mosMainBody(); ?>
</td>

<td width="150">
Right Column Content
<?php mosLoadModules ( 'right' ); ?>
</td>

</tr>
</table>

</div>

<div id="footer">
Footer
</div>

</div>

</body>
</html>


Posted by waking_life at 樂多Roodo! │16:35 │回應(0)引用(0)樣式表心法
樂多分類:網路/3C 共同主題:Joomla! 工具:編輯本文
Ads by Roodo! 

引用URL

http://cgi.blog.roodo.com/trackback/2777161