# Banner Topic on home page and only for anonymous users

**URL:** https://meta.discourse.org/t/banner-topic-on-home-page-and-only-for-anonymous-users/80959
**Category:** Support
**Created:** [2월 19, 2018, 7:11오후 UTC](https://meta.discourse.org/t/banner-topic-on-home-page-and-only-for-anonymous-users/80959 "2018-02-19T19:11:20Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Jay91](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jay91/32/135181_2.png) [@Jay91](https://meta.discourse.org/u/Jay91)
#### Post date: [2월 19, 2018, 7:11오후 UTC](https://meta.discourse.org/t/banner-topic-on-home-page-and-only-for-anonymous-users/80959/1 "2018-02-19T19:11:20Z")

</div>

Hello friends,

How i can make the banner topic show up on the home page and only for anonymous users, and when the user moves to a topic the banner disappear ?

Thanks in advance.

---

<div class="post-metadata">

### Author: ![Jay91](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jay91/32/135181_2.png) [@Jay91](https://meta.discourse.org/u/Jay91)
#### Post date: [2월 20, 2018, 6:15오후 UTC](https://meta.discourse.org/t/banner-topic-on-home-page-and-only-for-anonymous-users/80959/2 "2018-02-20T18:15:40Z")

</div>

Any help on this please !!

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [2월 20, 2018, 6:33오후 UTC](https://meta.discourse.org/t/banner-topic-on-home-page-and-only-for-anonymous-users/80959/3 "2018-02-20T18:33:57Z")

</div>

Does the Banner Topic accomplish what you’re looking for?

> [@New "Banner Topic" pin type](https://meta.discourse.org/t/new-banner-topic-pin-type/16458?source_topic_id=19353):
>
> One thing we’ve noticed is Discourse sites putting welcome banners up, like this: Technically this site welcome function is covered by the pinned welcome topic [image] But clearly we need something a bit more.. obvious.. for new users, as this is a recurring user-created design element on multiple Discourse sites. We also noted [in a random usability test](http://peek.usertesting.com/result/613760977075?autoplay=true) that a new arriving user indeed never found or read the pinned topic, at all. warning We proposing adding a new type of topic…

The banner shows for all users — but once a logged in user dismisses it then it’s gone forever; anon users can dismiss it (but the dismissed state is only saved locally on their device).

Additionally, you can target anon users using CSS (we add the class `.anon` to the HTML tag).

There are also some CSS classes to target either the topic-list pages (`body.navigation-topics`) or category pages (`body.navigation-categories`).

---

<div class="post-metadata">

### Author: ![Jay91](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jay91/32/135181_2.png) [@Jay91](https://meta.discourse.org/u/Jay91)
#### Post date: [2월 20, 2018, 6:40오후 UTC](https://meta.discourse.org/t/banner-topic-on-home-page-and-only-for-anonymous-users/80959/4 "2018-02-20T18:40:33Z")

</div>

> [@awesomerobot](#):
>
> Additionally, you can target anon users using CSS (we add the class .anon to the HTML tag).

do i need to add only this to HTML under nav bar location ?

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [2월 20, 2018, 6:52오후 UTC](https://meta.discourse.org/t/banner-topic-on-home-page-and-only-for-anonymous-users/80959/5 "2018-02-20T18:52:18Z")

</div>

So for example, in your customizations if you add HTML content (Admin \> Customize \> Themes \> Edit HTML/CSS \> Header/After Header/Footer):

```HTML
<div class="anon-content">
    <p>This is test content</p>
</div>

```

You can then add this to your CSS so that content only shows for anon users:

```CSS
.anon-content { 
    display: none; 
}

.anon .anon-content {
    display: block;
}

```

If you wanted to go further and only show that content for anon users on the category page, you could use this CSS:

```CSS
.anon-content { 
    display: none; 
}

.anon .navigation-categories .anon-content {
    display: block;
}

```

---

<div class="post-metadata">

### Author: ![Jay91](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jay91/32/135181_2.png) [@Jay91](https://meta.discourse.org/u/Jay91)
#### Post date: [2월 20, 2018, 6:53오후 UTC](https://meta.discourse.org/t/banner-topic-on-home-page-and-only-for-anonymous-users/80959/6 "2018-02-20T18:53:52Z")

</div>

yes i only want to show banner topic on the homepage and for non registered users only.

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [2월 20, 2018, 7:21오후 UTC](https://meta.discourse.org/t/banner-topic-on-home-page-and-only-for-anonymous-users/80959/8 "2018-02-20T19:21:21Z")

</div>

If you’re using a banner post and you want it to only show for anon users you’d add this to your CSS:

```CSS
#banner {
    display: none;
}

.anon #banner {
    display: block;
}

```

---

<div class="post-metadata">

### Author: ![Jay91](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jay91/32/135181_2.png) [@Jay91](https://meta.discourse.org/u/Jay91)
#### Post date: [2월 20, 2018, 7:41오후 UTC](https://meta.discourse.org/t/banner-topic-on-home-page-and-only-for-anonymous-users/80959/10 "2018-02-20T19:41:08Z")

</div>

yes worked fine, sorry for the last post, i closed the browser and re-open it… its working now.

Thank you so much.

---

<div class="post-metadata">

### Author: ![Jay91](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jay91/32/135181_2.png) [@Jay91](https://meta.discourse.org/u/Jay91)
#### Post date: [2월 20, 2018, 9:05오후 UTC](https://meta.discourse.org/t/banner-topic-on-home-page-and-only-for-anonymous-users/80959/11 "2018-02-20T21:05:54Z")

</div>

Dear Sir,

One more thing if you dont mind, the banner is showing on the mobile view, how i can hide it from mobile and keep it on desktop only?

Thanks in advance.

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [2월 20, 2018, 9:11오후 UTC](https://meta.discourse.org/t/banner-topic-on-home-page-and-only-for-anonymous-users/80959/12 "2018-02-20T21:11:41Z")

</div>

after the other CSS you added, add this:

```CSS
.mobile-view #banner {
    display: none;
}

```

---

<div class="post-metadata">

### Author: ![Jay91](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jay91/32/135181_2.png) [@Jay91](https://meta.discourse.org/u/Jay91)
#### Post date: [2월 20, 2018, 9:15오후 UTC](https://meta.discourse.org/t/banner-topic-on-home-page-and-only-for-anonymous-users/80959/13 "2018-02-20T21:15:34Z")

</div>

Many thinks sir, thanks for your time, worked like charm.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [6월 8, 2024, 12:37오후 UTC](https://meta.discourse.org/t/banner-topic-on-home-page-and-only-for-anonymous-users/80959/14 "2024-06-08T12:37:49Z")

</div>

이 주제는 2300일 후 자동으로 닫혔습니다. 더 이상 새로운 답변을 남길 수 없습니다.
