用到的Bundles有Zen Coding,960gs,joomla1.5,Zen CSS和Zen Html,使用这些可以使你的开发速度提高n个档次,基本上是成倍的效率往上翻。 首先,textmate只有Mac的版本且安装以上的Bundles,本文的快捷键只在Mac下有效,特此声明(主要是针对index.php)。

按住command+option+h,选择编辑模式为zen html,输入jhead,然后按tab键,就会出现以下code:

<!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" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
<head>
<jdoc:include type="head" />
<link rel="stylesheet" href="templates/<?php echo $this->template ?>/css/template.css" type="text/css" />
</head>
再补全结尾部分
<body>
</body>
</html>

该模板我们采用960gs开发,且此处我们使用的是12cols进行开发,在之后,输入c12,然后tab,就会出现相应的code,

<div class="container_12" id="name">
	
</div>
或者我们可以使用pp,然后tab,这边用于布局3等分,或者4等分,按tab之后,会出现两个选择,1为3等分,2为4等分,此处我们以3等分为例,则出现如下code:
<div class="container_12" id="name">
	<div class="grid_4">
		one
	</div>
	<div class="grid_4">
		two
	</div>
	<div class="grid_4">
		three
	</div>
</div>
这里,我们的tab键非常有用,按tab键,我们可以看到在切换我们要编辑的元素,id=“name”,可以将name换成你需要的id,例如,header。另外,我们可以自定义grid的大小,可以是grid10,可以是grid1,这边可以自行选择。

接下来我们继续讲插入module的方法,很简单,选择你要插入module的地方,module,然后tab,出现两个选项,1为判断位置是否存在的code,2为位置的code,此处我们插入的是module的位置,所以选择2,对应的code应该是:

<?php if($this->countModules('left')) : ?>
<jdoc:include type="modules" name="left" style="XHTML" />
<?php endif; ?>
将left换成你需要的module的名字,这样就可以了。

Joomla模板里面的content的插入方法是,content,然后tab,这样就可以了

<jdoc:include type="component" />

其他的还有jText之类的其他的,以后继续解释,下面贴了一个模板的code,仅供参考,

<!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" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
<head>
<jdoc:include type="head" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/general.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/template.css" type="text/css" />
<?php
if($this->countModules('left and right') == 0) $content = "12";
if($this->countModules('left or right') == 1) $content = "8";
if($this->countModules('left and right') == 1) $content = "4";
?>
</head>
<body>
	<div id="corner"></div>
	<div id="wrapper">
		<div class="container_12" id="header">
			<div class="grid_4 logo">
				<?php if($this->countModules('logo')) : ?>
					<jdoc:include type="modules" name="logo" style="raw" />
				<?php endif; ?>
			</div>
			<div class="grid_8">
				<?php if($this->countModules('search')) : ?>
				<div class="topsearch">
					<jdoc:include type="modules" name="search" style="raw" />		
				</div>
				<?php endif; ?>
			</div>
		</div>
		<div class="container_12" id="mainmenu">
			<?php if($this->countModules('mainmenu')) : ?>
			<jdoc:include type="modules" name="mainmenu" style="raw" />
			<?php endif; ?>
		</div>
		<div class="container_12" id="content">
			<?php if($this->countModules('left')) : ?>
			<div class="grid_4 left">
				<jdoc:include type="modules" name="left" style="raw" />
			</div>
			<?php endif; ?>
			<div class="grid_<?php echo $content ?> content">
				<jdoc:include type="component" />
			</div>
			<?php if($this->countModules('right')) : ?>
			<div class="grid_4">
				<jdoc:include type="modules" name="right" style="raw" />
			</div>
			<?php endif; ?>
		</div>
		<div class="container_12" id="advert">
			<div class="grid_4 advert1">
				<?php if($this->countModules('advert1')) : ?>
				<jdoc:include type="modules" name="advert1" style="raw" />
				<?php endif; ?>
			</div>
			<div class="grid_4 advert2">
				<?php if($this->countModules('advert2')) : ?>
				<jdoc:include type="modules" name="advert2" style="raw" />
				<?php endif; ?>
			</div>
			<div class="grid_4 advert3">
				<?php if($this->countModules('advert3')) : ?>
				<jdoc:include type="modules" name="advert3" style="raw" />
				<?php endif; ?>
			</div>
		</div>
		<div class="container_12" id="user">
			<div class="grid_3">
				<?php if($this->countModules('user1')) : ?>
				<jdoc:include type="modules" name="user1" style="raw" />
				<?php endif; ?>
			</div>
			<div class="grid_3">
				<?php if($this->countModules('user2')) : ?>
				<jdoc:include type="modules" name="user2" style="raw" />
				<?php endif; ?>
			</div>
			<div class="grid_3">
				<?php if($this->countModules('user3')) : ?>
				<jdoc:include type="modules" name="user3" style="raw" />
				<?php endif; ?>
			</div>
			<div class="grid_3">
				<?php if($this->countModules('user4')) : ?>
				<jdoc:include type="modules" name="user4" style="raw" />
				<?php endif; ?>
			</div>
		</div>
	</div>
	<div class="container_12" id="footer">
		<?php if($this->countModules('footer')) : ?>
		<jdoc:include type="modules" name="footer" style="raw" />
		<?php endif; ?>
	</div>
	<div class="container_12" id="copyright">
		<?php if($this->countModules('copyright')) : ?>
		<jdoc:include type="modules" name="copyright" style="raw" />
		<?php endif; ?>
	</div>
</body>
</html>
其中对left,content,right,三个位置进行了判断
<?php
if($this->countModules('left and right') == 0) $content = "12";
if($this->countModules('left or right') == 1) $content = "8";
if($this->countModules('left and right') == 1) $content = "4";
?>

templateDetails.xml这个文件也可以通过textmate去生成,编辑模式调成xml,然后templatexml,然后tab就可以了,按照你的需求,进行编辑,就可以了。