이 테마 컴포넌트는 Discourse 사용자 정의 내비게이션(사이드바) 메뉴 섹션을 특정 사용자 그룹(신뢰 수준 및 기본 그룹 포함)에게만 표시할 수 있게 해줍니다. 이 컴포넌트는 최대 8개의 사용자 정의 메뉴 섹션을 사용할 수 있으며, 각 지정된 섹션에 대해 원하는 만큼의 그룹을 지정할 수 있습니다. 대시(-)로 구분된 소문자 메뉴 섹션 이름을 사용해야 합니다(예: “Superuser Menu” = superuser-menu, “Staff Menu” = staff-menu). 그룹은 드롭다운 선택 필드를 통해 사용 가능한 그룹 중에서 선택합니다.
이 컴포넌트에서 지정된 사용자 정의 섹션은 공개적으로 설정되어 모든 사람에게 표시되도록 구성해야 한다는 점에 유의하세요. 새로운 그룹 내비게이션 메뉴 섹션을 만들려면 평소처럼 공개 섹션을 만든 후, 이 컴포넌트의 설정에서 표시하려는 그룹과 함께 포함시키면 됩니다. 사용자 정의 섹션을 설정하기 전에 컴포넌트 설정에서 섹션을 지정할 수 있으며, 올바른 섹션 이름만 사용한다면 컴포넌트로 제한하기 전에 모든 사람에게 섹션이 표시되지 않도록 방지할 수 있습니다.
이 컴포넌트는 사용자 정의 섹션을 위해 의도되었지만, 내비게이션 메뉴의 기존 섹션(예: 카테고리, 태그, 채널, 개인 채팅, 그리고 이제 비활성화된 “community” 상단 섹션)에도 사용할 수 있습니다. 예를 들어 슈퍼유저 및 스태프 그룹에게 사용자 정의 메뉴를 표시하는 동시에 새 사용자 그룹(trust_level_0)에서 태그와 채널을 숨길 수 있습니다. 특정 메뉴 섹션을 포럼 멤버에게만 표시하고(익명 사용자에게 숨김) 싶다면 trust_level_0 그룹에 표시하도록 설정할 수 있습니다.
이 컴포넌트에 사용하려는 모든 그룹의 경우, 그룹 상호작용 설정에서 그룹 가시성이 "Everyone"으로 설정되어 있어야 합니다.
설정:
설정 목록
이름
설명
menu 1
아래 설정의 그룹(들)에게 표시할 사용자 정의 메뉴 섹션 1. 소문자 슬러그 이름을 사용하세요.
display menu 1 for these groups only
메뉴 1에 사용할 사용 가능한 그룹의 드롭다운 선택기. 그룹 상호작용 설정에서 그룹 가시성이 Everyone으로 설정되어 있어야 합니다.
Create a new custom navigation menu section, called say “Anon Menu” (you can call it whatever you want, but remember the name) and make it a public section (check box at bottom of the modal).
Then in the Common-CSS of a theme or theme component that you create, insert this CSS code. Replace “anon-menu” with the section name-slug of the menu section name you created in step 1 (ie: Custom Section = custom-section).
In fact, I like this idea as a use case scenario and will add it to the component when I update it next. I’m building a JSON schema modal for the component’s settings so it’s a bit more intuitive to configure.
Thanks. This is more complex than I expected simply from a maintenance perspective I wouldn’t remember what I had done a few months down the line.
EDIT: My attempt to create an anonymous users group does NOT work because that’s only for the Anonymous feature, i.e. when a logged in user changes to Anonymous mode after logging in and not for truly anonymous users (users who don’t have an account).
Another suggestion, it would be great if it can read the list of groups and offer a dropdown to select from a list of available groups so one doesn’t have typo’s while writing the name of groups
Yes that’s correct, I’m referring to not-logged-in-users, people who land the website and haven’t logged in or don’t have an account.
I tried something above but it didn’t work because that’s a completely different feature (it caused more confusion that it should and I’m sorry about that).
I have updated this component with group drop-down selection boxes that populate with available groups. Also increased the number of menu sections to eight and added a globe icon hider.
Oh no it’s not, I just had that as part of the example menu name. For example, if the menu name is “User Info” then it would be “user-info”. The best way to do it is when you create the menu section, use the name in the Section title field and convert it to slug format with lowercase and dashes for spaces.
Russian I think? Whatever is in the Section title field I marked with an arrow in the first screenshot but with lowercase and dashes for spaces.
I just tested that configuration in my screenshot and it works.
Did you rename the community section in russian at any point? if not then using “community” should work (I’m assuming you mean the top unnamed default menu section).