# 按创建日期排序显示最新列表

**URL:** https://meta.discourse.org/t/show-latest-list-sorted-by-creation-date/140832
**Category:** Feature
**Created:** [2020年二月6日 09:07 UTC](https://meta.discourse.org/t/show-latest-list-sorted-by-creation-date/140832 "2020-02-06T09:07:45Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Javier\_Galan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/javier_galan/32/168997_2.png) [@Javier\_Galan](https://meta.discourse.org/u/Javier_Galan)
#### Post date: [2020年二月6日 09:07 UTC](https://meta.discourse.org/t/show-latest-list-sorted-by-creation-date/140832/1 "2020-02-06T09:07:45Z")

</div>

您好，我见过几个包含我所寻找解决方案的主题。

> [@How I can sort topics by topic creation date?](https://meta.discourse.org/t/how-i-can-sort-topics-by-topic-creation-date/26020):
>
> Or is there any url I can browse to see this? Thanks!

我认为我的问题与此帖中最近的 @abcoathup 的问题非常相似。

> [@How can I order by topic creation date?](https://meta.discourse.org/t/how-can-i-order-by-topic-creation-date/119880):
>
> I want to order by topic creation date. The only option I have found is latest?order=created\_at but this lists the topics based on the last activity date, so if topics have replies, then that impacts the order

然而，这个问题尚未得到解答。我该如何配置我的 Discourse 站点，以便用户访问主地址时直接跳转到 `mysitedomain/latest?order=created`？

此外，当用户点击“最新”按钮时，我该如何配置站点，使他们被重定向到 `mysitedomain/latest?order=created`？

谢谢！

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2020年二月6日 10:38 UTC](https://meta.discourse.org/t/show-latest-list-sorted-by-creation-date/140832/2 "2020-02-06T10:38:13Z")

</div>

目前无法实现，且暂无计划。您可以使用搜索功能，并选择“按最新主题排序”。

---

<div class="post-metadata">

### Author: ![Fer\_Cazares](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fer_cazares/32/183390_2.png) [@Fer\_Cazares](https://meta.discourse.org/u/Fer_Cazares)
#### Post date: [2020年七月6日 14:05 UTC](https://meta.discourse.org/t/show-latest-list-sorted-by-creation-date/140832/3 "2020-07-06T14:05:00Z")

</div>

你好 @codinghorror，能否指点我如何搜索并修改这个？我很希望能看到按创建日期排序的最新列表。

---

<div class="post-metadata">

### Author: ![Fer\_Cazares](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fer_cazares/32/183390_2.png) [@Fer\_Cazares](https://meta.discourse.org/u/Fer_Cazares)
#### Post date: [2020年七月6日 15:15 UTC](https://meta.discourse.org/t/show-latest-list-sorted-by-creation-date/140832/4 "2020-07-06T15:15:59Z")

</div>

我（算是）在我的论坛上通过重定向链接解决了这个问题，感谢这篇帖子：

> [@Redirect Category to External URL](https://meta.discourse.org/t/redirect-category-to-external-url/85691/13):
>
> Is there some specific version of the API I should be using for this?

* * *

* * *

将 `yoursite.com` 替换为您网站的名称。

[quote=]  
以下脚本在通过“自定义”添加到 `<head>` 后可实现预期效果：

```plaintext
<script type="text/discourse-plugin" version="0.8.19">
api.onPageChange(() => {
	if ( window.location.href === "https://yoursite.com/latest" ) {
		window.location.replace( "https://yoursite.com/latest?order=created" );
	}
});
</script>

```

[/quote]

**注意：** 如果您是开发者，请理解我并不是。请不要因此讨厌我 😝 我知道这并不是正确的做法。

---

<div class="post-metadata">

### Author: ![HeyRR](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heyrr/32/192157_2.png) [@HeyRR](https://meta.discourse.org/u/HeyRR)
#### Post date: [2020年八月30日 19:35 UTC](https://meta.discourse.org/t/show-latest-list-sorted-by-creation-date/140832/5 "2020-08-30T19:35:17Z")

</div>

我通过稍微修改这个组件让它起作用，也就是添加了一个“按日期排序”的按钮：

> [@Custom Top Navigation Links](https://meta.discourse.org/t/custom-top-navigation-links/87225):
>
> discourse2Summary Custom Top Navigation Links allows you to add links to Discourse top navigation.eyeglassesPreview [Preview on Discourse Theme Creator](https://discourse.theme-creator.io/theme/Discourse/custom-top-navigation-links)hammer_and_wrenchRepository Link [https://github.com/discourse/Discourse-nav-links-component](https://github.com/discourse/Discourse-nav-links-component)open_bookNew to Discourse Themes? [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) Install this theme component Features Desktop Mobile Settings: …

我在设置中通过以下方式传递 URL 查询参数：

`unfinished; unfinished; ?tags=unfinished`  
`created-time; created-time; ?order=created`

并在脚本中检查 `search` 参数：

```javascript

  api.modifyClass("component:navigation-item", {
    active: Ember.computed("contentFilterMode", "filterMode", function() {
      let contentFilterMode = this.get("content").get("filterMode");

      if (decodeURIComponent(window.location.search) === location) { // 检查 search 参数
        return contentFilterMode.includes(filter); // 如果包含该参数，则 active = true；
      } else {
        return this._super(contentFilterMode, this.get("filterMode"));
      }
    })
  });

```

这对我有效，但该脚本会刷新整个页面，而不仅仅是内部部分。有没有办法让它只刷新内部的 topic 组件？

---

<div class="post-metadata">

### Author: ![Terrapop](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@Terrapop](https://meta.discourse.org/u/Terrapop)
#### Post date: [2020年十一月12日 21:30 UTC](https://meta.discourse.org/t/show-latest-list-sorted-by-creation-date/140832/6 "2020-11-12T21:30:05Z")

</div>

嗨 @HeyRR，这个问题解决了吗？我们很多成员也希望能按创建日期而非活动日期对最新页面进行排序，对此很感兴趣。

---

<div class="post-metadata">

### Author: ![HeyRR](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heyrr/32/192157_2.png) [@HeyRR](https://meta.discourse.org/u/HeyRR)
#### Post date: [2020年十一月12日 22:58 UTC](https://meta.discourse.org/t/show-latest-list-sorted-by-creation-date/140832/7 "2020-11-12T22:58:04Z")

</div>

很抱歉，目前我没有更好的办法，只能使用上面提到的解决方案。我对该结构还不是很熟悉。

---

<div class="post-metadata">

### Author: ![D\_Merr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/d_merr/32/199962_2.png) [@D\_Merr](https://meta.discourse.org/u/D_Merr)
#### Post date: [2020年十一月12日 23:47 UTC](https://meta.discourse.org/t/show-latest-list-sorted-by-creation-date/140832/8 "2020-11-12T23:47:45Z")

</div>

我们希望能在自己的 Discourse 社区中看到这一功能。我们刚接触 Discourse，目前发现很难有效管理社区，确保用户的反馈、问题等内容不会被遗漏。由于我们团队成员分布在不同时区，不同版主之间的交接工作颇具挑战。如果我们能够轻松查看特定日期产生的所有活动，那就太好了。这样，即使在交接期间出现空档，我们也能看到那些在我们“值班”之外时段产生的活动。这也有助于我们根据活动创建时间，明确应由谁来回应这些活动。

---

<div class="post-metadata">

### Author: ![simonmic](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simonmic/32/367698_2.png) [@simonmic](https://meta.discourse.org/u/simonmic)
#### Post date: [2024年三月16日 23:50 UTC](https://meta.discourse.org/t/show-latest-list-sorted-by-creation-date/140832/9 "2024-03-16T23:50:06Z")

</div>

我也支持增加这方面的支持：

我们中的一些人非常习惯于按稳定的时间顺序浏览事物；这有助于我们利用人类的空间“硬件”来跟踪我们所看到的内容。一个论坛不断变化的“最新”视图（以及所有其他视图选项和其他 UI 元素）可能会让人感到有些混乱和压力。

而且，我花了很多时间在我们新的论坛中来理解和[解释](https://forum.plaintextaccounting.org/t/default-home-page-site-navigation-notes/195)“最新”实际上有两个重要的变体：“最新活跃/置顶”，如果你点击网站标题就可以看到；以及“最新创建”，如果你点击“最新”导航链接就可以看到。

目前，“最新创建”（`?order=created`）可以配置为“分类”视图的默认视图，但不能配置为“最新”视图的默认视图。

我们也相当怀念拥有一个“最新创建/置顶”的选项。目前，在“最新”和“分类”视图中，我们可以按时间顺序显示主题，或者在顶部显示置顶的欢迎主题，但不能同时显示两者。

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2024年三月18日 03:05 UTC](https://meta.discourse.org/t/show-latest-list-sorted-by-creation-date/140832/10 "2024-03-18T03:05:00Z")

</div>

是的，我明白了。

我认为我们需要重新考虑 Discourse 中的“主页”设置，允许任何路由成为主页，并让用户灵活选择他们想要的主页。目前菜单上有 5 到 6 个项目，但实际上我们可以通过允许“自定义…”作为主页来支持数百个项目。

---

<div class="post-metadata">

### Author: ![simonmic](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simonmic/32/367698_2.png) [@simonmic](https://meta.discourse.org/u/simonmic)
#### Post date: [2024年三月18日 03:23 UTC](https://meta.discourse.org/t/show-latest-list-sorted-by-creation-date/140832/12 "2024-03-18T03:23:34Z")

</div>

增加趣味性：我注意到当我（通过各种方式）导航到“Top”或“Hot”时，它们的 URL 经常（但不总是）会添加 ?order=created，这会使其失去意义。还没有弄清楚是什么触发了这个问题！

---

<div class="post-metadata">

### Author: ![dsims](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dsims/32/485916_2.png) [@dsims](https://meta.discourse.org/u/dsims)
#### Post date: [2025年九月23日 00:28 UTC](https://meta.discourse.org/t/show-latest-list-sorted-by-creation-date/140832/13 "2025-09-23T00:28:41Z")

</div>

将 `created_at` 设置为默认排序的插件：[Created as Default Sort Order](https://meta.discourse.org/t/created-as-default-sort-order/370920)
