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. :globe_with_meridians: على الفئات المعينة لـ everyone
  2. لا يوجد أيقونة معينة على الفئات التي تسمح بالوصول إلى trust_level_0
  3. :unlock: معين على جميع الفئات الأخرى

هذا المكون يجب أن يفعل ذلك يا ناثان.

نعم، هذا ما أستخدمه. في حقل svg-icons، أدخل users, user-friends وأي رمز تريده للوصول العام (بالنسبة للكرة الأرضية، أستخدم أيقونة من Freepik، والتي أضفتها إلى Discourse الخاص بي عبر مكون سمة تم تحميله)

أخفي أيقونة القفل باستخدام CSS هذا المضاف إلى مكون سمة:

// لا توجد أيقونة قفل للفئات الخاصة
.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;
     }
}

بالطبع، سيتعارض هذا مع أي أيقونات من مكون أيقونات الفئة، ولكن يمكن التخفيف من ذلك عن طريق استهداف .d-icon-lock (أو أي أيقونة تستخدمها) بدلاً من .d-icon لتلك الفئة.


لقد قمت للتو بتعديل CSS هذا بعد اكتشاف أنني كنت أفتقد بعض الأيقونات. إنه يعمل بشكل أفضل الآن، ولكنه سيتعطل بسهولة إذا قمت بتغيير هيكل الفئة الخاص بك.

إعجابَين (2)

تحديث طفيف لهذا حتى تتمكن من استخدامه مع الشريط الجانبي:

// يخفي أيقونات القفل لفئة تجربة المستخدم
.sidebar-section-link-ux .prefix-badge {
    display: none;
}
.category-ux .list-controls, [href = "/c/ux/9"] {
    .d-icon-lock,  {
        display: none;
    }
}
إعجاب واحد (1)

بالنسبة لقوائم منسدلة لتحديد الفئات، أضفت هدفًا آخر:

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

أيضًا، بالنسبة لقنوات الدردشة أقترح: [href *= "chat/channel/9/"]

إعجاب واحد (1)