帝国CMS模板读取远程页面内容(readhttp) 和引用文件标签 (includefile)
1、开启标签 后台--模板--标签--标签管理--修改(选择对应标签)--开启
2、读取远程页面 (readhttp) [readhttp]'http://127.0.0.1/bbs//incfile/head.html'[/readhttp] 可以是本站的但是要写绝对路径
引用文件标签 (includefile)
---------------------------------------------------------------------------------------------------------------------------------------
include自定义页面方法:(自定义页面在后台>“栏目”>“自定义页面”里增加)
include 自定义页面有两种方法(userpage.html在根目录):
第一种:页面生成.html文件情况下,
模板用<?php include(ECMS_PATH.'userpage.html');?>
或 [includefile]'../../page1.html"'[/includefile]
或 <?php require(ECMS_PATH.'userpage.html');?>
或 <?=sys_includefile('../../page1.html')?>
调用文件。
第二种:页面生成.shtml文件,用<!--#include file="/userpage.html"-->调用文件。
技巧说明:
1、自定义页面存放目录说明:
<?php include(ECMS_PATH.'userpage.html');?>与<!--#include file="/userpage.html"-->
上面例子是以自定义页面生成到根目录为例,你也可以单独建个自定义页面存放目录,比如:/incpage/ 目录那模板include就是用:
<?php include(ECMS_PATH.'/incpage/userpage.html');?>与<!--#include file="/incpage/userpage.html"-->
2、自定义页面可以设置定义生成,以让文件内容实时更新:
在后台>“系统”>“计划任务”>“管理刷新任务”里增加定时刷新自定义页面。
3、如果是不同栏目不同自定义页面如何引用?
(1)、增加自定义页面按栏目ID命名,比如:/incpage/userpage1.html (其中1为栏目ID)
(2)、模板中include文件用:
<?php include(ECMS_PATH.'/incpage/userpage'.$GLOBALS[navclassid].'.html');?>
或
<?php require(ECMS_PATH.'/incpage/userpage'.$GLOBALS[navclassid].'.html');?>
或
<!--#include file="/incpage/userpage<?=$GLOBALS[navclassid]?>.html"-->
相关帝国教程
- 12-06帝国wap内容模板里过滤掉图片尺寸的方法
- 09-11灵动标签判断索引加样式
- 06-29帝国CMS模板调用最新最多评论文章的方法
- 10-25帝国CMS模板上下翻页页码有哪些方法
- 01-29帝国cms上传附件名规则成功改为源文件名+随机码
- 01-24帝国CMS egetip()获取用户IP函数
- 08-16帝国cms日期用英文显示的方法
- 12-28帝国CMS SQL标签多表查询
- 10-27帝国CMS函数版首页、列表页、内容页调用TAG标签终级教程
- 03-19帝国CMS内容页字段为空判断的用法
- 02-02帝国CMS后台页面加批量勾选
- 04-18帝国CMS给当前信息添加new最新图标
- 10-22帝国CMS模板php灵动标签循环栏目带文章(一级栏目、子栏目、子栏目下的文章)
- 08-24帝国cms采集规则过滤广告正则针对内容newstext的选择
- 02-10帝国cms列表页模板里推荐信息添加一个图标
- 02-22帝国CMS使用教程系统限制的登录次数不得超过 5 次...
- 05-04帝国cms数据表phome_ecms_news_data_1
- 07-26帝国cms指定id范围随机调用信息
- 11-09帝国CMS一些调用URL地址
- 11-03帝国CMS在首页列表页模板调用内容页下载地址的方法