修改 DirectoryTables

我知道问这个问题很蠢,但我承认自己也很蠢。

如何在自定义主题中修改此内容:

<DirectoryTable
              @items={{this.model}}
              @columns={{this.columns}}
              @showTimeRead={{this.showTimeRead}}
              @order={{this.order}}
              @asc={{this.asc}}
            />

(编辑)目标可能是将其更改为使用 div 的行和列。

1 个赞

在你回复之前,Kris,我很感谢你的时间。

1 个赞

时机正好!本周我已开始更新目录,将从 <table> 迁移到更灵活的 div 布局,并使用 CSS Grid 重新创建表格布局。因此,如果您能等一两周,这将成为新的默认设置。

否则,您将不得不从主题内部覆盖我们此处提供的默认模板。我们将在 Developing Discourse Themes & Theme Components 中提供有关模板覆盖的一些详细信息。

2 个赞

这正是我需要的,非常感谢!

按位置排序?首先显示最近的成员?:innocent:

我已经安装了自定义主题,修改了此文件:“https://github.com/discourse/discourse/blob/ba3f62f576068035bc8fbda615e595960cd4520c/app/assets/javascripts/discourse/app/components/directory-table.hbs”,并检查和安装了更新,但没有看到任何更改。我添加了一个类到“directory-table-container”作为测试。我需要重建容器吗?
修改后的文件位置:
$theme/javascripts/discourse/app/components/directory-table.hbs

我已经弄清楚了 table 和 tds,但是 tr 标签到底在哪里?

此先前提到的工作已合并到 Discourse 中,我们不再使用 table 来处理用户表,而是使用 div 和 CSS 网格的组合。

您需要检查 DirectoryItem 组件,它位于:https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/components/directory-item.hbs

1 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.