Make "New Topic" button more prominent

AI-generated summary

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 можно прочитать здесь.

Beginner's guide to using Discourse Themes

6 лайков

О, замечательно. Я просто скопировал и вставил это, и всё заработало. Впервые добавил код в что-либо. Очень волнительно, и выглядит отлично. Спасибо @Johani.
Есть ли способ изменить текст по умолчанию «Новая тема» на «Создать новую тему» или что-то ещё более заметное?

1 лайк

Конечно, перейдите в admin/customize/site_texts и выполните поиск по js.topic.create

Это даст вам два результата

Первый относится к кнопке, которую вы видите в списках тем. Второй — к кнопке отправки в редакторе при создании новой темы.

Вы можете изменить текст обеих записей на любой удобный для вас.

3 лайка

Огромное спасибо, это очень полезно. Я уже изменил.

1 лайк

Я был в отпуске и не следил за своей электронной почтой. Спасибо @joe за напоминание! Я даже не помню, что я делал, это было так давно! :blush:

3 лайка