# 비로그인 사용자에게 사이드바를 숨기는 방법?

**URL:** <https://meta.discourse.org/t/how-do-i-hide-the-sidebar-for-anon-viewers/250311>\
**Category:** Support\
**Tags:** sidebar\
**Created:** [1월 1, 2023, 1:22오후 UTC](https://meta.discourse.org/t/how-do-i-hide-the-sidebar-for-anon-viewers/250311 "2023-01-01T13:22:55Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)\
**Post date:** [1월 1, 2023, 1:22오후 UTC](https://meta.discourse.org/t/how-do-i-hide-the-sidebar-for-anon-viewers/250311/1 "2023-01-01T13:22:55Z")

</div>

우리 사이트에는 #sidebar가 구성되어 있으며, 대부분 비공개 콘텐츠에 일부 공개 콘텐츠가 섞여 있습니다.

우리는 사이드바가 사용자가 로그인한 상태일 때만 활성화되기를 매우 원합니다(즉, `anon` 사용자에게는 표시하지 않음).

다음 CSS를 시도해 보았습니다:

```css
// hide sidebar from non-logged in users (stuffs up layout unfortunately)
.anon {
    .sidebar-wrapper, .header-sidebar-toggle {
        display: none;
   }
}

```

이 CSS는 사이드바를 숨기지만, 사이드바 레이아웃은 그대로 남아 있습니다(그리고 모양이 좋지 않습니다). 더 나은 방법이 있을까요?

새로운 헤더 드롭다운 뷰(navigation\_menu 아래)로 전환하여 그렇게 처리할 수 있다는 것은 알고 있지만, 가능하면 로그인한 사용자에게는 클릭 없이 사이드바가 표시되기를 정말로 원합니다.

---

_[View the full topic](https://meta.discourse.org/t/how-do-i-hide-the-sidebar-for-anon-viewers/250311)._
