又一个.net自定义cms [英] Yet another .net custom cms

查看:210
本文介绍了又一个.net自定义cms的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将我用php写的自定义cms切换到.net c#。我想用cms作为一个学习项目。我要使用C#,NHibernate ORM层,mssql,mvc3和jquery。

I'm trying to switch my custom cms written in php into .net c#. I was thinking to use cms as a learning project. I'm going to use C#, NHibernate ORM layer, mssql, mvc3 and jquery.

我知道有很多广告或开源的cms,但我还是要花一些我的空闲时间尝试学习项目的新技术喜欢这个。

I'm aware there are plenty of commercials or open source cms, but still I'm going to spend some of my free time trying to learn new technology working on project like this.

所以,有没有人愿意分享一些关于创建cms域模型,有用的链接,想法等的想法。

So, is there anyone out there who is willing to share some ideas on creating cms domain model, usefull link, ideas, etc.

感谢

推荐答案

一个真正基本的CMS包含3个元素:

A really basic CMS consist of 3 elements:


  • 一个数据库表来保存您的页面。表结构是name和content

  • 将类型 / cms / pagename 的请求转换为固定控制器, cms pagename 作为参数的方法

  • 一个可嵌入的html编辑器

  • one database table to hold your "pages". The table structure is "name" and "content"
  • a route to transform requests of type /cms/pagename to a fixed controller, the method called cms and pagename as a parameter
  • a embeddable html editor

现在,您可以使用两种方式调用页面。它是创建模式或查看/编辑模式。

Now, there are two ways your "page" can be invoked. It is either create mode or view/edit mode.

在创建模式下,请求页面,但不在数据库中(例如 cms / announcement1 )。在这种模式下,您创建一个由html编辑器组成的视图,并在提交时将该页面持久化到数据库。

In "create" mode, the page is requested but it is not in the database yet (e.g. cms/announcement1). In this mode you create a view consisting of a html editor and upon submit, you persist the page to the database.

在view模式下,是数据库中的IS。您可以执行任何必要的重写(例如,将 [cms / pagename] 的内部链接重写为完全可路由的http地址)并呈现内容。

In "view" mode, the page is requested and is IS in the database. You perform any necessary rewriting (for example you rewrite internal links of the form [cms/pagename] to a fully routable http address) and render the content.

如果用户被授权编辑页面,您还将显示一个编辑按钮,然后调用html编辑器并加载页面并准备编辑。

If the user is authorized to edit the page, you also show a "edit" button which then invokes the html editor with the page loaded and ready to be edited.

就是这样。

有大量额外的元素(缓存,不同的内置页面类型,嵌入图像,youtubes,预格式化的文本)等,但所有这些都是可选的,你可以

There are tons of additional elements (caching, different built-in page types, embedding images, youtubes, preformatted texts) etc. but all of them are optional and you can introduce new features when you have the core already implemented.

一旦我按照上面的结构编写了一个简单的CMS,它是一个更大的解决方案的一部分,直到现在,部署数百次。自定义CMS的一个优点是,它可以真正简单,轻松maintanable。

Once I wrote a simple CMS following the structure above, it was a part of a bigger solution and till now it's been sucesfully deployed several hundred times. An advantage of a custom CMS is that it can be really simple and easily maintanable.

这篇关于又一个.net自定义cms的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆