pbootcms头部底部文件如何分离

PbootCMS系统 admin 416浏览

观察发现要仿制的网站共用一个模板头部和底部文件,对此,我们可以新建head.html头部模板文件和footer.html底部模板文件.

操作1.将网站首页div的class名为header的代码剪切至head.html模板,原来位置填写{include file=head.html}

模板文件嵌套引用{include file=***.html}
使用说明:
可以嵌套使用,如:index.html 嵌套一个head.html,同时head.html中嵌套comm.html
支持使用子目录,如:{include file=comm/***.html}

操作2.将网站首页div的class名为footer的代码以下部分剪切至footer.html模板,原来位置填写{include file=footer.html}

操作3.修改footer.html模板底部导航调用代码,其中也可以加入控制参数num=*,限制导航调取数量

<div class="footer-nav"> 
<a href="">网站首页</a>  
<a href="index2.html">关于我们</a>  
<a href="index6.html">产品展示</a>  
<a href="index9.html">新闻中心</a>  
<a href="index13.html">客户案例</a>  
<a href="index19.html">解决方案</a>  
<a href="index20.html">在线留言</a>  
<a href="index1.html">联系我们</a>  
</div>
<div class="footer-nav"> 
<a href="{pboot:sitedomain}">网站首页</a>
{pboot:nav}
<a href="[nav:link]">[nav:name]
</a>
{/pboot:nav}
</div>

修改4.用PB代码替换如下调用信息

微信图标{pboot:companyweixin}联系电话{pboot:companyphone}传真号码{pboot:companyfax}联系手机{pboot:companymobile}联系邮箱{pboot:companyemail}公司地址{pboot:companyaddress}公司名称{pboot:companyname}站点备案信息{pboot:siteicp}站点版权{pboot:sitecopyright}

转载请注明:大灰牛博客 » pbootcms头部底部文件如何分离