Mixing a Category & "Featured" Topics

AI-generated summary

Takumo is creating a blog-style presentation of Discourse topics, featuring the latest announcements and selected topics from any category. To achieve this, Takumo would like to restrict staff from setting a specific tag, allowing them to “feature” certain topics without pinning them.

sam suggests using the staff_tags setting in site settings, which allows only staff to apply specific tags. Additionally, staff can limit the ability to create and apply tags to certain trust levels by modifying the min trust to create tag and min trust level to tag topics settings.

Hi All,

I’d like to present topics from discourse in a blog-style, to replace a rather unloved blog.

I’ve already got an “Announcements” category in which only staff can create new topics.
I’d like to also have the option for staff to select topics from any category and market them (e.g. with a tag).

I’ve written a small Sinatra app which then collates the 10 latest Announcements and featured posts to show in a blog format.

Is it possible to restrict setting a tag (or tagging in general) to staff? Or is there another way to feature a topic without pinning it.

Here’s the code (using the discourse_api gem to help illustrate the idea

    announcements = API.category_latest_topics(category_slug: 'announcements').take 10
    features      = API.show_tag('food')["topic_list"]["topics"].take 10
    topics = (announcements + features).flatten
    topics.each { |t| t["created_at"] = Time.parse(t["created_at"]) }
    featured_topics = topics.sort { |a,b| a["created_at"] <=> b["created_at"] }.reverse.take 10
```

As a side note is there a way to just limit these API calls to returning the 10 most recent and paginating?

Yes, have a look at staff_tags in site settings, those tags can only be applied by staff.

Also you can set min trust to create tag and min trust level to tag topics in site settings.