默认模板存放在 ./templates/default/phpcms/ 目录里。
header.html、index.html、footer.html 三个模板文件。这可是模板的灵魂啊!完整页面模板就是header index footer了.
打开header.html如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" /> <title>{$head[title]}</title> <meta content="{$head[keywords]}" name="keywords" /> <meta content="{$head[description]}" name="description" /> <base href="{SITE_URL}" /> <link href="favicon.ico" rel="shortcut icon" /> <link href="{SKIN_PATH}{$mod}.css" rel="stylesheet" type="text/css" /> <script language="JavaScript" src="data/config.js"></script> <script language="JavaScript" src="images/js/jquery.min.js"></script> <script language="JavaScript" src="images/js/css.js"></script> <script language="JavaScript" src="images/js/common.js"></script> <script language="JavaScript" src="images/js/login.js"></script> <script language="JavaScript" src="images/js/validator.js"></script> </head> <body onload="menu_selected('{php echo $catid ? $catid : $mod;}')"> <div id="top"> {if isset($MODULE['search'])} {php $types = include PHPCMS_ROOT.$MODULE['search']['path'].'include/type.inc.php';} <div class="f_r"> <form name="site_search" action="{$MODULE[search][url]}" target="_blank"> <input type="hidden" name="type" value="all"/> <input type="text" name="q" size="20"/> <select> <option value="all">全部</option> {loop $types $k $name} <option value="{$k}">{$name}</option> {/loop} </select> <input type="submit" name="s" id="button" value="搜索" /> </form> </div> {/if} <div class="f_l"> <div id="div_login" style="display:block"> <form action="{$MODULE[member][url]}login.php" method="post" name="login" onsubmit="return loginSubmit(this, {$PHPCMS[uc]});"> 用户名:<input type="text" name="username" size="12"/> 密码:<input type="password" name="password" size="12"/> <input type="submit" name="dosubmit" value="登录" /> <input type="button" name="register" value="注册" onclick="redirect('{$MODULE[member][url]}register.php')"/> <input type="hidden" name="cookietime" value="0"/> </form> </div> <div id="div_logined" style="display:none"> <span id="logined_username" class="b"></span>,<a href="{$MODULE[member][url]}">会员中心</a> | <a href="{if $PHPCMS['uc']}{$MODULE[member][url]}logout.php{else}javascript:logout('{$MODULE[member][url]}logout.php?action=ajax');{/if}">退出登录</a> </div> </div> </div> <div id="head"> <div id="logo"> <a href="{SITE_URL}"><img src="images/logo.gif" alt="{$PHPCMS[sitename]}" /></a> <a href="{SITE_URL}rss.php" target="_blank"><img src="images/rss.jpg" alt="rss信息聚合" /></a></div> <div class="ad" id="topbanner"><script language="javascript" src="data/js.php?id=1"></script></div> </div> <div id="menu"> <ul> <li><a href="" id="menu_phpcms"><span>首页</span></a></li> {tag_一级栏目} <li><a href="{$MODULE[special][url]}" id="menu_special"><span>专题</span></a></li> <li><a href="{$MODULE[ask][url]}" id="menu_ask"><span>问吧</span></a></li> <li><a href="{$MODULE[search][url]}" id="menu_search"><span>搜索</span></a></li> </ul> </div>
打开index.html如下:
<!--begin main--> <div id="main"> <!--begin left--> <div id="main_l"> <!--begin 焦点图片,新闻--> ******************************中间部分代码太长 此处省略处理****************************** <!--begin 全站搜索--> <!--{if isset($MODULE['search'])}--> <script type="text/javascript"> function set_type(type) { $('#type').val(type); $('#search_tag>span').removeClass('selected'); $('#type_' type).addClass('selected'); } </script> <form name="search" action="{$MODULE[search][url]}" target="_blank"> <div class="search_tag_top mar_10"> <p id="search_tag"> <span id="type_all" class="selected" onclick="set_type('all')">全部</span> {php $types = include PHPCMS_ROOT.$MODULE['search']['path'].'include/type.inc.php';} {loop $types $type $name} <span id="type_{$type}" onclick="set_type('{$type}')">{$name}</span> {/loop} </p> </div> <div class="cribox_bdr_1"> <input type="hidden" name="type" value="all" id="type"/> <input type="text" name="q" size="50"/> <input type="submit" name="s" id="button" value="搜索" /> </div> </form> <div class="cribox_btm"></div> <!--{/if}--> ******************************中间部分代码太长 此处省略处理****************************** <!--{if isset($MODULE['link'])}--> <h4><a href="{$MODULE[link][url]}"><img src="images/more.gif" alt="更多" /></a>友情链接</h4> <div class="pic_txt_list_1"> {tag_logo链接} </div> <div class="pic_txt_list_1"> {tag_文字链接} </div> <!--{/if}--> </div> <!--end right--> </div> <!--end main-->
打开footer.html如下:
<div id="foot"> <a href="">网站首页</a>{tag_关于我们}<br /> <strong>{$PHPCMS['copyright']}</strong><br /> <a href="/" target="_blank">{$PHPCMS[icpno]}</a> <a href="/" class="copyright" target="_blank">Powered by Phpcms 2008</a> </div> </body> </html>
【PhpCms模板制作代码】相关文章:
★ 帝国cms在列表模板获取上级栏目名称
★ PhpCms问吧伪静态设置
★ 帝国cms模板教程之栏目自定义字段调用教程及代码
★ PhpCms内容管理:生成HTML
★ 帝国CMS模板制作教程:列表模板图文详解
★ dedecms实现将表单订单发送到邮箱实例代码
★ PhpCms作者管理设置
★ PhpCms模块管理:表单向导
★ phpcms语法规则
★ dede软件列表模板中div css使软件缩略图靠左