대체 새 주제 버튼 (카테고리별)

:information_source: Summary Changes the text of the New Topic button per category.
:hammer_and_wrench: Repository github.com/nathan-nz/category-new-topic-button
:question: Install Guide How to install a theme or theme component
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

This theme component allows you to customise the “Create Topic” button label in Discourse for specific categories, for the specific use case of dedicated Events categories.

It can easily be forked and modified for other use cases; it wasn’t practical to make this configurable.

How It Works

This component leverages Discourse’s API to override the default “Create Topic” button label based on category-specific needs. It allows admins to control which categories display custom labels and what that label should be.

Configuration and Settings

  • Settings Options:

    • Category Event Labels: A setting allows administrators to pick specific categories that should use the new_event translation (“New Event” by default).
    • Default Behaviour: For categories not specified in the settings, the button will default to displaying the new_topic translation (“New Topic” by default).
  • How to Configure:

    1. Access Settings: Navigate to the theme settings section in your Discourse admin panel.
    2. Select Categories: Use the category picker under the “Category Event Labels” setting to select categories you want labelled as “New Event.”
    3. Save and Update: After making selections, save your changes to apply the new button labels instantly.

This component is designed to be simple yet powerful, giving you the flexibility to either apply uniform or categorised customisation to your forum’s interface.

4개의 좋아요

How does this compare to the Customize new topic button text theme component?

4개의 좋아요

아! 그 TC를 완전히 놓치고, 서로 연결되지 않은 것으로 보이는 몇몇 오래된 스레드에 빠져 있었습니다. 바로 처리하겠습니다!

이 TC는 기본 버튼을 숨기고 새 버튼으로 대체하는 대신, 텍스트만 변경합니다. 제 사용 사례는 Custom Wizard Plugin 🧙 의 Wizard로 라우팅을 수행하는 경우이기도 해서, 이 방식이 필요합니다.

하지만 Customize new topic button text (설정 배열, 다른 버튼 포함 등)의 완성도에 감탄했고, 다시 살펴보니 작은 수정만으로도 새 버튼의 라우트를 변경할 수 있음을 확인했습니다. 이 TC를 유지하기보다는 해당 TC를 (조금) 확장하는 것이 더 나을 것 같습니다.

이를 위해 #contribute:feature를 등록했으며, pull request도 포함했습니다:

3개의 좋아요