通过对exo cms portal, mambo以及ibm的cms也深入研究,我决定要取它们的长处,利用他们的思想,但是要简化
它们的设计。针对cms里面非常重要的前台导航,我采用以下的设计方法
/* 前台内容节点设计
note_type: 路径=0,节点=1
content_type: 静态html=1,动态脚本=2
use_layout : 是否使用布局文件,就是类似于sitemesh一样的布局,使用它可以免去定义头,脚和导航菜单
*/
create table tbl_cms_node (
node_id int(11) unsigned not null default '0',
label varchar(255) not null default '',
path varchar(255) not null default '',
name varchar(255) not null default '',
parent_node_id int(11) not null default '0',
node_type char(1) not null default '',
content_type char(1) not null default '',
use_layout char(1) not null default '',
layout varchar(10) not null default '',
primary key (node_id)
) type=innodb;
insert into tbl_cms_node values (1, 'index', '/', '首页', '0','1','2','n','');
insert into tbl_cms_node values (2, 'xxjj', '/', '学校简介', '0','0','' ,'' ,'');
insert into tbl_cms_node values (3, 'index', '/xxjj/', '学校简介首页','2','1','1','y','wrap');
insert into tbl_cms_node values (4, 'xxgk', '/xxjj/', '学校概况', '2','1','1','y','wrap');
insert into tbl_cms_node values (5, 'xxdt', '/xxjj/', '学校动态', '2','0','' ,'' ,'');
insert into tbl_cms_node values (4, 'index', '/xxjj/xxdt/', '学校动态首页文章列表', '5','1','2','y','wrap');
insert into tbl_cms_node values (4, 'n', '/xxjj/xxdt/', '学校动态文章', '5','1','2','y','wrap');
/*
"/cms" 下解析的use case
1. /cms/ 没有文件后缀的,补上index.html
2. /cms/index.html 找到路径/ 下的index
3. /cms/xxjj/index.html 找到路径/xxjj/ 下的index
4. /cms/xxjj/xxgk.html 找到路径/xxjj/ 下的xxgk
5. /cms/xxjj/xxdt/index.html 找到路径/xxjj/xxdt/ 下的index
6. /cms/xxjj/xxdt/index_1.html 找到路径/xxjj/xxdt/ 下的index,把pageno=1做为一个变量放在context里面
7. /cms/xxjj/xxdt/n00000001.html 找到路径/xxjj/xxdt/ 下的n,把00000001作为一个变量article_id=0000001放在context里面
*/
闽公网安备 35060202000074号