`
反求诸己
  • 浏览: 534887 次
  • 性别: Icon_minigender_1
  • 来自: 湖南娄底
社区版块
存档分类
最新评论

jeecms模板

 
阅读更多

  以修改download中的模板channel_level2.html为例,介绍下模板在后台的加载过程。
1. 首先找到对应的struts-core-admin.xml.
<!--模板管理-->
<package name="core.template" namespace="/admin/core/template" extends="core-default">
<action name="Com_*" method="{1}" class="core.templateAct">
<result name="list">/WEB-INF/core_sys/template/list.html</result>
<result name="add">/WEB-INF/core_sys/template/add.html</result>
<result name="edit">/WEB-INF/core_sys/template/edit.html</result>
<result name="left">/WEB-INF/core_sys/template/left.html</result>
<result name="right">/WEB-INF/core_sys/template/right.html</result>
<result name="main">/WEB-INF/core_sys/template/main.html</result>
<result name="solution">/WEB-INF/core_sys/template/solution.html</result>
<result name="exportTpl">/WEB-INF/core_sys/template/export_tpl.html</result>
<result name="importTpl">/WEB-INF/core_sys/template/import_tpl.html</result>
</action>
</package>


2. 对应的edit.html

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>edit</title>
<#include "/WEB-INF/core_sys/head.ftl"/>
<script type="text/javascript">
function ajaxSubmit() {
$.postJson('${base}/admin/core/template/ajax/update.do', {
'tplName' : $('#tplName').val(),
<#if tplName?starts_with("tag_")>
'tplContent' : $('#tplContent').val(),
<#else>
'tplContent' : FCKeditorAPI.GetInstance('FCKeditor1').GetHTML(true),
</#if>
'relPath' : $('#relPath').val(),
'uploadRuleId': ${uploadRuleId}
}, function(data) {
if (data.success) {
alert(data.msg);
} else {
alert(data.msg);
}
});
}
</script>
</head>
<body>
<div class="body-box">
<div class="rhead">
<div class="rpos">当前位置: 模板管理 - 修改</div>
<form class="ropt" method="post">
<input type="submit" value="返回列表" onclick="this.form.action='Com_list.do?relPath=${parentPath?j_string}';"/>
</form>
<div class="clear"></div>
</div>
<@p.form labelWidth="15" onsubmit="ajaxSubmit();return false;">
<@p.td label="模板文件名">${tplName}<@p.hidden id="tplName" name="tplName"/></@p.td><@p.tr/>
<@p.td>
<#if tplName?starts_with("tag_")>
<div>按ctrl+s可以直接保存</div>
<@p.textarea id="tplContent" name="tplContent" style="width:100%;" cols="70" rows="20" onkeydown="if((event.keyCode==115||event.keyCode==83)&&event.ctrlKey){ajaxSubmit();return false;}"/>
<#else>
<script type="text/javascript">
var oFCKeditor = new FCKeditor('FCKeditor1');
oFCKeditor.BasePath='${base}/fckeditor/';
oFCKeditor.Config["CustomConfigurationsPath"]="${base}/fckeditor/myconfig.js?"+(new Date()*1);
//oFCKeditor.Config["CustomConfigurationsPath"]="${base}/fckeditor/myconfig.js";
oFCKeditor.ToolbarSet='template';
oFCKeditor.Config["TabSpaces"]=2;

oFCKeditor.Config["LinkUpload"] = false;
oFCKeditor.Config["ImageUpload"] = false;
oFCKeditor.Config["FlashUpload"] = false;
<#if uploadRuleId??>
oFCKeditor.Config["uploadRuleId"]=${uploadRuleId};
</#if>
<#if !parentPath?contains("include") && !tplName?starts_with("inc_")>
oFCKeditor.Config["FullPage"]=true;
</#if>
oFCKeditor.Config["EnterMode"]='p';
oFCKeditor.Config["FormatOutput"]=true;
oFCKeditor.Config["FillEmptyBlocks"]=false;
oFCKeditor.Config["FromSrc"]="\\$\\{root\\},\\$\\{sysResRoot\\},\\$\\{base\\}";
oFCKeditor.Config["ToView"]="${web.userResUrl},${web.sysResUrl},${web.webUrl}";
oFCKeditor.Config["FromView"]="${web.userResUrl},${web.sysResUrl},${web.webUrl}";
oFCKeditor.Config["ToSrc"]  ="${r'${root}'},${r'${sysResRoot}'},${r'${base}'}";
oFCKeditor.Height=350;
oFCKeditor.Value="${tplContent?js_string}";
oFCKeditor.Create();
</script>
</#if>

</@p.td><@p.tr/>
<#--
<@p.td><@p.editor id="tplContent" name="tplContent" height="400" fullPage="true"/></@p.td><@p.tr/>
-->
<@p.td>
<input type="hidden" name="uploadRuleId" value="${uploadRuleId}"/>
<@p.hidden id="relPath" name="relPath" />
<@p.submit value="保存"/> &nbsp; <@p.reset value="重置"/>
</@p.td>
</@p.form>
</div>
</body>
</html>

3. 找到submit出发的action标签 p,在freemarker.properties中

auto_import="/WEB-INF/ftl_lib/ponyjava.com/index.ftl" as p, "/WEB-INF/ftl_lib/jeecms/index.ftl" as cms

4.找到P标签定义的ftl,button.ftl

<#--
<input type="submit"/>
-->
<#macro submit
value="提交"
id="" name="" class="" style="" size="" title="" disabled="" tabindex="" accesskey=""
onclick="" ondblclick="" onmousedown="" onmouseup="" onmouseover="" onmousemove="" onmouseout="" onfocus="" onblur="" onkeypress="" onkeydown="" onkeyup="" onselect="" onchange=""
>
<input type="submit"<#rt/>
value="${value}"<#rt/>
<#if id!=""> id="${id}"</#if><#rt/>
<#include "common-attributes.ftl"/><#rt/>
<#include "scripting-events.ftl"/><#rt/>
/><#rt/>
</#macro>

4. 继续研究后台是怎么更新的。。。

分享到:
评论

相关推荐

    JeeCMS模板

    非常超值的JEECMS模板,非常漂亮美观!简洁设计!纯手工打造!

    jeecms v8.1 源码

    JEECMSv8.1是一款支持微信小程序、栏目模型、内容模型交叉自定义、以及具备支付和财务结算的内容电商为一体内容管理系统:通过后台的简单设置即可自定义出集新闻管理、图库管理、视频...doc/jeecms模板置标使用手册.doc

    Jeecms 标签数据表详细介绍

    jeecms标签列表和示例 jeecms数据表 jeecms模板标签说明 比较全哦!

    JeeCMS前台模板

    非常漂亮的一套模板,持续更新当中,每天更新一点点!现在的还不是最终完美版哦,不过接近完美版了!

    jeecms2012模板制作教程

    jeecms2012模板制作教程

    JEECMS3.x模板标签使用说明

    JEECMS3.x模板标签使用说明 JEECMS3.x模板标签使用说明 收集整理 mrzhou@miw.cn www.miw.cn

    jeecms2012sp1默认模板-template-default.zip

    jeecms2012sp1默认模板-template-default.zip

    JEECMS v2.3.2 Final版是JEECMS面世以来发布的第一个正式版是JEECMS面世以来发布的第一个正式

    二、核心模板全部使用文件形式保存,自由导入/导出模板,极大方便了用户模板设计、网站升级转移、全站换肤; 三、首页、栏目页缓存处理,在启动了页面缓存后,有利于提高系统反应速度,降低系统资源的消耗; 四、...

    JEECMS3.x模板标签使用说明.pdf

    JEECMS3.x模板标签使用说明.pdf

    CMS模板置标使用手册

    jeecms模板使用说明书,主要介绍了首页、新闻栏目、新闻内容、单页、投票模块、全文搜索、评论、留言管理、专题标签的使用以及常用参数说明

    jeecms-3.1.1网站制作模板

    基于ssh框架开发的一款强大的网站制作模板,后台mysql数据库,支持oracle等主流数据库,专门用来制作网站的系统,附源代码及使用教程。

    jeecms_v2012标签使用,模版配置

    CMS模板置标使用手册 一、首页页面分析 2 1.1首页导航 2 1.1.1一级导航 2 1.1.2多级导航 2 1.2首页图片切换 2 1.3首页新闻列表 2 1.4带有new图标,字体加粗,变色的首页新闻列表 2 1.5图文新闻 2 1.5.1类型图 2 ...

    jeecms 2012.zip

    Jeecms v2012版是一款集新闻管理、图库管理、视频管理、下载系统、作品管理、产品发布及留言板于一体的综合性CMS系统。从2012版起,jeecms将更注重用户体验、系统性能和实际应用的研发,让jeecms的适用范围更广、...

    jeecms_3.0+标签的使用

    jeecms3.X标签使用详解,对初学jeecms者有较大帮助

    jeecms v9.3 正式版 安装包.zip

    jeecms v9.3 正式版 安装包 更新日志 1、栏目添加选择模型模板只选择一个报错 2、内容复用待审核查询报错(开源版) 3、根栏目添加内容报错 4、后台页面样式调整 5、后台编辑器分页问题 7、数据统计今日...

    jeecms_v2012后台管理图文手册

    jeecms v2012版后台管理 1 栏目 1 栏目 1 1.1相关名词解释 2 1.2栏目模型管理: 3 1.3栏目添加 5 1.4 栏目修改、删除操作说明 7 2 内容 7 2.1功能区组成 7 2.2内容类型: 8 2.3内容类型专题管理 10 3 图片集 13 3.1...

    jeecms 网站开发源码

    JEECMS是JavaEE版网站管理系统(Java Enterprise Edition Content Manage System)的简称。 · 基于java技术开发,继承其强大、稳定、安全、高效、跨平台等多方面的优点 · 采用hibernate3+spring mvc+spring2+...

    jeecms v9.3 正式版 源码包.zip

    jeecms v9.3 正式版 源码包 更新日志 1、栏目添加选择模型模板只选择一个报错 2、内容复用待审核查询报错(开源版) 3、根栏目添加内容报错 4、后台页面样式调整 5、后台编辑器分页问题 7、数据统计今日...

    freemarker及jeecms标签使用学习文档

    freemarker文档两个,有助于理解和学习freemarker。jeecms标签文档能够帮助你理解模板总的自定义标签。更加方便学习

    JEECMS 3.04 显示与模板标签字符 GBK UTF8对照

    JEECMS默认是在unix下不支持中文模版文件的, 本语言包解决了默认主页的中文文件名问题

Global site tag (gtag.js) - Google Analytics