asp.net/c#开发的CMS系统,刚搭建了宏阳映画艺术设计网!
用asp.net/c#写了自己用的CMS系统,生成各频道静态页面,各个频道页面通过xml配置,解析xml后,在服务器端生成HTML。
,刚搭了个网站宏阳映画艺术设计网,网络地址: www.mzscl.com/index.html
XML配置分为:布局,区域,组,webprat
其中布局配置可以嵌套,布局下面是区域集合,区域下市webpart组集合,组里是webpart集合。
页面配置如下:
<?xml version="1.0" encoding="utf-8" ?>
<cmsPages>
<cmsPage include="home.config"/>
<cmsPage include="list.config"/>
</cmsPages>
<?xml version="1.0" encoding="utf-8" ?>
<cmsPage id="home" autoGenerateID="0">
<profiles>
<profile name="seo">
<seo name="title" value="首页"/>
<seo name="keyword" value="艺术设计"/>
<seo name="description" value="宏阳映画艺术设计网"/>
</profile>
<profile name="css">
<css src="Resources/CSS/Profile.css"/>
</profile>
<profile name="script">
</profile>
</profiles>
<webLayouts>
<webLayout id="layout_banner_1" styleName="layout_lr" orderID="1">
<webPartZone id="webpartzone_banner_1" isShowTitle="0" isShowHeader="0" isShowFooter="0" isShow="1" orderID="1">
<webpartGroup title="网站顶部自动隐藏广告" isShow="1">
<webPart id="webpart_banner_1" styleName="html_skin" dataID="3" columns="1" rows="1" imageLinkEnabled="0" imageLabelEnabled="0" linkMoreEnabled="0" isShow="1" orderID="1">
<dataProvider name="" type="YC330.MINGMING.DataSources.CMSContentDataSource,YC330.MINGMING.DataSources.dll"></dataProvider>
<skinProvider name="" type="YC330.MINGMING.Skins.HTMLSkin,YC330.MINGMING.Skins.dll"></skinProvider>
</webPart>
</webpartGroup>
</webPartZone>
</webLayout>
<webLayout id="layout_page_header" styleName="layout_lr" orderID="2">
<webPartZone id="webpartzone_page_header" isShowTitle="0" isShowHeader="0" isShowFooter="0" isShow="1" orderID="1">
<webpartGroup title="网站头部" isShow="1">
<webPart id="webpart_page_header" styleName="html_skin" dataID="1" columns="1" rows="1" imageLinkEnabled="0" imageLabelEnabled="0" linkMoreEnabled="0" isShow="1" orderID="1">
<dataProvider name="" type="YC330.MINGMING.DataSources.CMSContentDataSource,YC330.MINGMING.DataSources.dll"></dataProvider>
<skinProvider name="" type="YC330.MINGMING.Skins.HTMLSkin,YC330.MINGMING.Skins.dll"></skinProvider>
</webPart>
</webpartGroup>
</webPartZone>
<webPartZone id="webpartzone_page_banner" isShowTitle="0" isShowHeader="0" isShowFooter="0" isShow="1" orderID="2">
<webpartGroup title="首页图文混合广告区" isShow="1">
<webPart id="webpart_page_banner" styleName="html_skin" dataID="4" dataLevel="0" columns="1" rows="1" imageLinkEnabled="0" imageLabelEnabled="0" linkMoreEnabled="0" isShow="1" orderID="1">
<dataProvider name="" type="YC330.MINGMING.DataSources.CMSContentDataSource,YC330.MINGMING.DataSources.dll"></dataProvider>
<skinProvider name="" type="YC330.MINGMING.Skins.HTMLSkin,YC330.MINGMING.Skins.dll"></skinProvider>
</webPart>
</webpartGroup>
</webPartZone>
</webLayout>
</webLayouts>
配置解析:
/// <summary>
/// 文件系统CMSPage解析
/// </summary>
private static void AnalyseCMSConfig()
{
WebPageSettingEntity webPageSetting;
XmlNodeList childNodes = xmlRoot.ChildNodes; //cmsPage集合
for (int i = 0; i < childNodes.Count; i++)
{
if (childNodes[i].NodeType != XmlNodeType.Element) continue;
if (childNodes[i].Attributes["include"] != null)
{
XmlNode includeXMLRoot;
XmlNode profilesNode;
XmlNode layoutsNode;
XmlDocument includeXMLDoc = new XmlDocument();
string includeConfigFilename = WebConfig.CustomConfigRoot + childNodes[i].Attributes["include"].Value;
includeXMLDoc.Load(HttpContext.Current.Server.MapPath(includeConfigFilename));
includeXMLRoot = includeXMLDoc.DocumentElement;
webPageSetting = new WebPageSettingEntity();
webPageSetting.ID = includeXMLRoot.Attributes["id"].Value;
profilesNode = includeXMLRoot.ChildNodes[0];
layoutsNode = includeXMLRoot.ChildNodes[1];
//个性化
WebProfileSettingEntity webProfileSetting = new WebProfileSettingEntity();
//布局集合
List<WebLayoutSettingEntity> webLayoutSettings = new List<WebLayoutSettingEntity>();
//解析WebProfile
Analyse_WebProfile(profilesNode, webProfileSetting);
//解析WebLayout
Analyse_WebLayouts(layoutsNode, webLayoutSettings);
webPageSetting.ProfileSetting = webProfileSetting;
webPageSetting.LayoutSettings = webLayoutSettings;
//新增CMSPage
WebConfig.CMSConfig.CMSPages.Add(webPageSetting);
}
else
{
webPageSetting = new WebPageSettingEntity();
webPageSetting.ID = childNodes[i].Attributes["id"].Value;
//个性化
WebProfileSettingEntity webProfileSetting = new WebProfileSettingEntity();
//布局集合
List<WebLayoutSettingEntity> webLayoutSettings = new List<WebLayoutSettingEntity>();
//解析WebProfile
Analyse_WebProfile(childNodes[i], webProfileSetting);
//解析WebLayout
Analyse_WebLayouts(childNodes[i], webLayoutSettings);
webPageSetting.ProfileSetting = webProfileSetting;
webPageSetting.LayoutSettings = webLayoutSettings;
//新增CMSPage
WebConfig.CMSConfig.CMSPages.Add(webPageSetting);
}
}
}
各频道页面地址如下:
家装彩绘频道 : http://www.mzscl.com/jzch/index.html
质感墙艺频道:http://www.mzscl.com/zgqy/index.html
室内设计频道:http://www.mzscl.com/snsj/index.html
创意设计频道:http://www.mzscl.com/cysj/index.html
汽车彩绘频道:http://www.mzscl.com/qcch/index.html
动画制作频道:http://www.mzscl.com/dhzz/index.html
包装印刷频道:http://www.mzscl.com/ycys/index.html
装饰挂画频道:http://www.mzscl.com/zsgh/index.html
另外还有相册,如下:
家装彩绘相册:http://www.mzscl.com/Gallery/Special.aspx?id=1
质感墙艺术相册:http://www.mzscl.com/Gallery/Special.aspx?id=2
客户留言地址:http://www.mzscl.com/messageboard/index.html