允许用户创建页面

发布于 2024-09-27 03:37:58 字数 163 浏览 0 评论 0原文

我想允许用户在我的网站上创建页面。不是整页,只是默认模板的内容。

我目前正在使用 http://ckeditor.com/ 然后将内容保存到数据库中。

这是执行此操作的最佳方法吗?

I would like to allow users to create pages on my site. Not full pages, but just content for the default template.

I am currently using http://ckeditor.com/ then saving the content into a database.

Is this the best way to go about doing this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

海螺姑娘 2024-10-04 03:37:58

这太模糊了。为用户提供编辑器然后将内容保存在数据库中是最好的方法吗?当然。事实上,很难想出任何其他合理的方法。

CKEditor 是最好的编辑器吗?这取决于您和您的用户。 Stack Overflow 使用一个带有一些按钮的简单文本区域来添加 Markdown 代码。这效率更高,但非技术用户会讨厌它。我个人倾向于使用 TinyMCE,许多用户通过在 WordPress 中使用它而认识到它。

哪种编辑器适合您的网站取决于您和您的用户。

至于将其保存在数据库中,您还可以将其放在哪里?显然,您必须将访问者写入的内容保存在某种数据库中。

您询问的是一些非常非常广泛的决策,这些决策几乎不属于此类解决方案的“最佳实践”。更有趣的问题是:它如何保存在数据库中,如何控制谁有权访问,如何跟踪以前的版本,如何验证要显示的内容,如何防止多个用户覆盖彼此的编辑,用户如何从查看页面转到编辑页面?

That's awfully vague. Is giving users an editor and then saving the content in a database the best approach? Sure. In fact, it'd be hard to come up with any other reasonable approach.

Is CKEditor the best editor? That's up to you and your users. Stack Overflow uses a simple textarea with some buttons to add markdown code. That's far more efficient, but non-technical users would hate it. I personally tend to use TinyMCE which many users recognize from its use in WordPress.

Which editor is right for your site depends on you and your users.

And as far as saving it in a database, where else could you put it? Obviously you'll have to save what the visitors write in a database of some kind.

You're asking about some very, very broad decisions that are hardly part of the "best practice" for this sort of solution. More interesting questions are: how is it saved in the database, how do you control who has access, how do you keep track of previous versions, how do you validate which content to display, how do you prevent multiple users from overwriting each other's edits, how do users get from viewing the page to editing the page?

情深如许 2024-10-04 03:37:58

Perhaps it would be easier (and safer, and prettier, etc.) to use something like Simple CMS?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文