Categories: public vs. logged in only vs. restricted

Is there a way to distinguish between categories visible to logged in users only and categories visible to certain groups?

At the moment, I use CSS to hide the lock icon in front of all categories that are visible to logged-in users only. Now I would like to put a group icon in front of categories that are restricted to groups.

「いいね!」 3

While I understand your question, I am thinking about the use case. Especially because only users who can see the categories, see the categories regardless of groups or logged-in state. So how would the differentiation help? I do not think there is way though, but I might be wrong.

The use case is the same as for the lock icons, which, I think, is to remind users: if you post here or share a link from here it won’t be accessible by everyone.

I feel like I don’t need that reminder for login-only categories, because very few categories on my site are visible to anonymous users. (Instead, I mark the publicly visible category’s with an :eye: icon to remind users that these are out in the open internet.)

For categories that have more restrictions than “must be logged in”, it can be less obvious that they’re for a more or less exclusive group only. New users might have been granted access to a group when they first created their account. So from day one they’re seeing a different set of categories than some other users, but unless the category name or description (if they read it) includes a hint, they couldn’t tell that a category is visible only to some. Older users might forget that this one category they once were granted access to is not in fact accessible by all.

So, in short, a quick visual reminder like the lock icon makes more sense to me for restricted categories than applying it to almost all categories on a mostly logged-in only site.

「いいね!」 2

We’ve recently made a category restricted to a higher trust level and now people keep thinking those topics have been closed. Closed and restricted are different things and it is confusing for them to have the same icon. A lock is generally understood to indicate that the person seeing it doesn’t have full access, not that it is hidden from other people.

「いいね!」 1

In the meantime, I decided to indicate in front of each category, what the level of access is. I’m using a globe for categories that are public (anonymous access), a “group” icon for categories accessible by logged-in users and a “friends” icon for other restricted categories.
Screen Shot 2020-10-13 at 09.55.39

「いいね!」 2

これをどのように実現していますか?素晴らしいアイデアだと思います。サイトをいくつかの公開カテゴリを持つように進めていく中で、それらにも同様のことを行いたいと考えています。グローブも気に入りました!

以下を実現したいです。

  1. everyone に設定されたカテゴリの :globe_with_meridians:
  2. trust_level_0 へのアクセスを許可するカテゴリのアイコンなし
  3. その他のすべてのカテゴリの :unlock:

これでできるはずです、ネイサン。

はい、それを使っています。svg-icons フィールドに users, user-friends と、パブリックアクセスに使用したいシンボルを入力してください(地球儀には、Freepik によるアイコンを使用しており、これは テーマコンポーネントにアップロードしたスプライト経由で Discourse に追加しました)。

テーマコンポーネントに追加したこの CSS でロックアイコンを非表示にしています。

// no lock icon for private categories
.category .badge-category.clear-badge.restricted .d-icon-lock, 
.badge-category.clear-badge.restricted .d-icon-lock,
.category-list .category-text-title .d-icon-lock,
.category-box-heading .d-icon-lock {
    display:none;
}
「いいね!」 1

あなたのアイデアのバリエーションを思いつきました。TL_0(手動)からアクセス可能なカテゴリのみでロックアイコンを選択的に非表示にすることができます。

これに便利なCSSクラスがないため、ホバー(title)とリンク(href)のプロパティを対象にする必要があります。また、ロックアイコンを非表示にしたい各カテゴリに対してこれを行う必要があります。

// uxカテゴリのロックアイコンを非表示にする
[title = "ux"], [href = "/c/ux/9"] {
     .d-icon {
         display: none;
     }
}

もちろん、これはCategory Icons Componentのアイコンと競合しますが、カテゴリごとに.d-iconの代わりに.d-icon-lock(または使用しているアイコン)を対象にすることで軽減できます。


アイコンの一部が欠けていることに気づいたため、CSSを編集しました。これでうまく機能しますが、カテゴリ構造を変更すると簡単に壊れてしまいます。

「いいね!」 2

サイドバーで使用できるように、これを少し更新しました。

// uxカテゴリのロックアイコンを非表示にする
.sidebar-section-link-ux .prefix-badge {
    display: none;
}
.category-ux .list-controls, [href = "/c/ux/9"] {
    .d-icon-lock,  {
        display: none;
    }
}
「いいね!」 1

カテゴリ選択ドロップダウンメニューには、さらに1つのターゲットを追加しました。

.category-ux .list-controls, [href = "/c/ux/9"], [data-value = "9"] {
    .d-icon-lock,  {
        display: none;
    }
}

チャットチャンネルには、[href *= "chat/channel/9/"] を提案します。

「いいね!」 1