是否可以重新排序主题列表栏(首页)?

你好,

有没有办法按照下图所示重新排列列?

注意:我在浏览器中交换了元素的顺序(将用户放在主题之前),并修改了 Mozilla 安装中的一些属性,从而实现了上述效果。

原因:
每当需要在网站上查看最左侧的项目列表时,我总是觉得有些别扭。我发现内容稍微居中的布局更容易阅读,但这可能只是我个人的怪癖。

如果您能提供一些关于最佳实现方法的建议,我将不胜感激:

  • 是否可以通过 Discourse 设置来实现?
  • 直接从 Discourse 源代码中更改顺序?
  • 开发全新的首页设计(类似 WordPress 主题)?
  • 仅使用 CSS?
  • 其他方法?

There’s no way to do this with the settings, and if you directly edit the source of Discourse you’ll lose progress whenever you update.

I think there are two ways this could work, both of these require using a theme so you can upgrade Discourse without losing your work:

  • CSS only: It wouldn’t be a completely trivial task because you’d be editing how the table layout works. The way I would approach it would be by defining each row in the table (tr) as a flex item, you’d then be able to order the cells in the row (td) by using the order property of flex box.

  • Overriding the topic-list template. This is quicker to do, but would likely require more ongoing maintenance to keep up with updates. You can take a look at this theme here to get an idea of how it works: Sam's Simple Theme. Specifically, this file in that theme takes the core Discourse topic-list template and overrides it.

8 个赞

Thanks @awesomerobot

I think I can work with overriding the template.

请告诉我您是如何更改“Users”列的位置并将其移到左侧的?