模板引用说明
2022-08-03 09:57:03
220
{{single.collect_count}}

模板引用说明

模板引用也可以叫做页面调用,在页面执行的时候将指定模板文件的代码引用到当前页面来。

对于网站头部、尾部、页面侧边导航等公共部分可以引用过来,以免每个页面都去编写这些公共页面

87b6c8409402f7a5e9b71e434f084e14.png

上图就是首页页面结构,实际上是把头部、中间、底部代码用三个模板文件分开,这样做的好处就是内页也可以调用header.html和footer.html。

栏目页和内容页的页面结构多了网站位置position.html文件

页面引用语法

例如引用页头模板header.html

{template 'header.html'}

页面引用可以让模板制作非常的灵活,主要看如何运用。

页底模板footer.html

{template 'footer.html'}

面包屑导航position.html

{template 'position.html'}

语言项引用语法

例如引用“网站首页”这个后台可编辑固定语言包

{lang('homepage')}

其中“homepage”为语言项调用项

用 CmsEasy 助您「轻松搭建」企业官网。

Copyright © www.cmseasy.cn 2017 all right reserved,Powered by

CmsEasy

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}