CMS网站的文章存储 [英] Article storage for CMS site

查看:118
本文介绍了CMS网站的文章存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



基本上,我需要建立一个CMS类网站.
如果用户提交文章,什么是存储文章的最佳方法.无论是xml还是数据库.
本文将包含丰富的文本格式,如内容,图像,突出显示的源代码.
请指导我最好的存储方式.

谢谢
Ashok

Hi,

basically i have requirement to build a CMS kind of site.
if user submits a article what is the best way to store the article. whether it is xml or database.
the article will contain rich text formatting like content,images,highlighting source code.
please guide me best way of how to store.

Thanks
Ashok

推荐答案

由于这是一个网站,请记住您必须将文章以HTML格式显示.嗯,有些站点以可下载文件的形式将文章显示为PDF,Word文档等其他格式,但最好还是忘掉它.

那么,为什么不将文章存储为HTML(作为文件或数据库)呢?您可以将样式表静态保存在单独的文件中,文章文件将只引用它.

您可能还想从一些更严格的表示中即时生成HTML代码,例如要使用XSLT转换的XML.请参见 http://en.wikipedia.org/wiki/XSLT [ http://www.w3.org/TR/xslt20/#xslt-mime-definition [
As this is a Web site, remember you have to present the article as HTML. Well, there are sites that presents articles as downloadable files in other formats as PDFs, Word documents… but better forget about it.

So, why not storing articles as HTML (as files or in database)? You can keep style sheets statically in separate files, article files will just refer to it.

You may also want to generate HTML code on the fly from some more strict presentation such as XML to be translated using XSLT; see http://en.wikipedia.org/wiki/XSLT[^], http://www.w3.org/TR/xslt20/#xslt-mime-definition[^]. Using this approach you could dynamically format source code using syntax-sensitive rules and a lot more.

—SA


这篇关于CMS网站的文章存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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