PHP 用户设置显示顺序

发布于 2024-10-07 16:57:54 字数 125 浏览 0 评论 0原文

我正在尝试构建一个 CMS,并且想知道如何拥有它以便后端的用户可以动态设置页面显示顺序。我知道MySQL如何进行ORDER BY,但我希望用户能够说这个页面应该是第一个,等等。我什至不知道如何解决这个问题,所以任何帮助将不胜感激!谢谢!

I am trying to build a CMS and was wondering how I can have it so the user on the backend can dynamically set the pages display order. I know with MySQL how to the ORDER BY but I want the user to able to say this page should be first, etc. I am not even sure how to approach this so any help would be greatly appreciated! Thanks!

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

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

发布评论

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

评论(1

皓月长歌 2024-10-14 16:57:54

只需将“order”INT 字段添加到您的“pages”表或您存储这些数据的位置即可。然后,只需为用户提供以某种方式进行编辑的选项,例如拖放页面,然后在设置导航时,只需按顺序字段进行排序即可。

Just add an 'order' INT field to your 'pages' table, or where ever you are storing the data for those. Then just give the user the option of editing that somehow, such as drag n' dropping the page, then, when setting up the navigation, just order by the order field.

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