Make "New Topic" button more prominent

AI 生成的摘要

The discussion revolves around making the “New Topic” button more prominent in Discourse. alehandrof shares a custom styling using .btn-primary to improve visibility, noting it works well for small, private communities. codinghorror explains this is intentional to encourage users to explore existing topics first. AndreasZhou seeks guidance on implementing the change, and Johani provides CSS and site text instructions to customize the button’s appearance and label. AndreasZhou confirms the changes were successfully applied, and alehandrof later thanks the community for the follow-up.

I had some users complain that it wasn’t obvious how to post a new topic, so I styled the button to look like .btn-primary. I think that might be a good default, actually:

(I also changed the “create” vocabulary to “post” since taking the screenshot, but that’s another matter altogether :slight_smile: )

4 个赞

This is intentional, we believe people should look for existing topics first before rushing to create a new one. Reply is primary action not create topic.

6 个赞

Ah, interesting! For our community, we currently want new users to be able to find how to ask questions more easily. We’re a small, private community. But I can see why this would be counterproductive in large, public, and active forums.

2 个赞

Yes it’s totally fine to change this to whatever you want locally on your discussions, my comments are in the context of global defaults for all sites.

6 个赞

看起来很棒,非常感谢!我很想把我们的“新建话题”按钮改成你使用的那种布局。我不是程序员,在技术知识有限的情况下,有什么建议吗?@alehandrof

前往 admin/customize/themes,并将以下内容添加到你的活动主题的 common > CSS 下:

#create-topic {
  background: var(--tertiary);
  color: var(--secondary);
  svg {
    color: var(--secondary);
  }
  
  &:hover {
    background: var(--tertiary-hover);
    svg {
      color: var(--secondary);
    }
  }
}

你可以在此处阅读更多关于 Discourse 主题的内容。

6 个赞

太棒了,我复制粘贴后立刻就成功了。这是我第一次在任何地方添加代码,非常令人兴奋,而且效果看起来很棒。谢谢 @Johani!
有没有办法将默认的“新建主题”文案改成“创建新主题”或其他更引人注目的文字?

1 个赞

好的,请前往 admin/customize/site_texts 并搜索 js.topic.create

这将显示两个结果:

第一个结果对应您在话题列表中看到的按钮。第二个结果对应创建新话题时编辑器中的提交按钮。

您可以将这两个文本编辑为您喜欢的任何内容。

3 个赞

非常感谢,这非常有用。我已经修改好了。

1 个赞

我休假期间没有跟进邮件。感谢 @joe 的跟进!事实上,事情过去太久了,我甚至不记得自己当时做了什么!:blush:

3 个赞