# Inconsistent body class for /admin paths? (disabling top navigation)

**URL:** https://meta.discourse.org/t/inconsistent-body-class-for-admin-paths-disabling-top-navigation/60694
**Category:** Support
**Created:** [April 9, 2017, 10:44pm UTC](https://meta.discourse.org/t/inconsistent-body-class-for-admin-paths-disabling-top-navigation/60694 "2017-04-09T22:44:22Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [April 9, 2017, 10:44pm UTC](https://meta.discourse.org/t/inconsistent-body-class-for-admin-paths-disabling-top-navigation/60694/1 "2017-04-09T22:44:22Z")

</div>

I am using a simplified top navigation bar like the one that used to be on [try.discourse.org](http://try.discourse.org) based on the code provided here:

[https://meta.discourse.org/t/branding-discourse-experiment-on-try-discourse/3387/4?u=tophee](https://meta.discourse.org/t/branding-discourse-experiment-on-try-discourse/3387/4)

It works fine with one exception: when I access `/admin` directly (without having loaded the forum previously in the same tab) the top-navigation bar doesn’t load so that I see only the default discourse header like here on meta.

From what I can tell, it seems to have something to do with the body class: when navigating the forum as an admin starting from any forum-URL not including `/admin`, the body class does not include `docked` unless I scroll down to make the nav bar disappear. In contrast, when navigating the forum starting from a forum-URL including `/admin`, then the body class is fixed to `staff docked` (And the nav-bar is hidden when the class is docked).

I would expect the default class under `/admin` to be simply `staff` and `docked` to be added when scrolling, just like everywhere else. Is this is an inconsistency in the discourse core or am I misunderstanding something and it is only the CSS code above that is missing something? In the latter case: what is missing?

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [April 10, 2017, 12:38am UTC](https://meta.discourse.org/t/inconsistent-body-class-for-admin-paths-disabling-top-navigation/60694/2 "2017-04-10T00:38:25Z")

</div>

> [@tophee](#):
>
> It works fine with one exception: when I access /admin directly (without having loaded the forum previously in the same tab) the top-navigation bar doesn’t load so that I see only the default discourse header like here on meta.

It’s the normal behaviour. Styling is not supported in that area.

See here:

[https://meta.discourse.org/t/custom-styling-doesnt-apply-to-admin-pages/15077/9?u=trash](https://meta.discourse.org/t/custom-styling-doesnt-apply-to-admin-pages/15077/9)

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [April 10, 2017, 1:08am UTC](https://meta.discourse.org/t/inconsistent-body-class-for-admin-paths-disabling-top-navigation/60694/3 "2017-04-10T01:08:51Z")

</div>

> [@Trash](#):
>
> It’s the normal behaviour. Styling is not supported in that area.

I see. Except that my custom stylesheet _does_ work under `/admin` when I navigate there from the front-end and within the same browser tab. Differently said: the admin section has different body classes depending on how you navigate there.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [April 10, 2017, 1:12am UTC](https://meta.discourse.org/t/inconsistent-body-class-for-admin-paths-disabling-top-navigation/60694/4 "2017-04-10T01:12:50Z")

</div>

I’ve noticed this as well. Sometimes certain parts of our custom CSS will affect Admin (like button shadows), but mostly it doesn’t. I can’t say for sure, but @tophee’s description of navigating in from the front-end seems accurate. I’ve had a dedicated Admin tab lately (lots of customization stuff) and I never see the issue there. A full refresh of any admin page will also remove the CSS customizations that are appearing.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 10, 2017, 1:29pm UTC](https://meta.discourse.org/t/inconsistent-body-class-for-admin-paths-disabling-top-navigation/60694/5 "2017-04-10T13:29:31Z")

</div>

> [@tophee](#):
>
> when I access /admin directly (without having loaded the forum previously in the same tab) the top-navigation bar doesn’t load so that I see only the default discourse header like here on meta.

For a very very long time, we disabled all customizations on first load for `/admin` path. Now that we have `safe-mode` route I am not sure this is as required. We may change this.

The problem is that people would mess up a customization and then have no idea how to bring site back into operation.

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [April 10, 2017, 3:16pm UTC](https://meta.discourse.org/t/inconsistent-body-class-for-admin-paths-disabling-top-navigation/60694/6 "2017-04-10T15:16:13Z")

</div>

> [@sam](#):
>
> The problem is that people would mess up a customization and then have no idea how to bring site back into operation.

Makes complete sense. What I would suggest, though is to make this behaviour transparent so that admins understand that they must look at the front end to verify their customizations and don’t waste their time trying to figure out what is going wrong with their code. Here would be a good place for this:

 ![](https://global.discourse-cdn.com/meta/original/3X/8/8/8873d13b84cebf71001f4f81987261dc3f086ce8.png)  
Add something like "For security reasons, most customizations are not applied to the admin section of the site.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [April 10, 2017, 6:41pm UTC](https://meta.discourse.org/t/inconsistent-body-class-for-admin-paths-disabling-top-navigation/60694/7 "2017-04-10T18:41:45Z")

</div>

> [@sam](#):
>
> For a very very long time, we disabled all customizations on first load for /admin path.

I realized my post might not have been clear. I’m 100% in favor of not using custom CSS or JS when looking at any `/admin` path - I was just trying to clarify that I’ve noticed inconsistency too.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [May 23, 2019, 7:00pm UTC](https://meta.discourse.org/t/inconsistent-body-class-for-admin-paths-disabling-top-navigation/60694/8 "2019-05-23T19:00:39Z")

</div>



---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [May 26, 2019, 11:06pm UTC](https://meta.discourse.org/t/inconsistent-body-class-for-admin-paths-disabling-top-navigation/60694/9 "2019-05-26T23:06:16Z")

</div>

I don’t think anything is left to do here? Right?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [June 1, 2019, 8:00am UTC](https://meta.discourse.org/t/inconsistent-body-class-for-admin-paths-disabling-top-navigation/60694/10 "2019-06-01T08:00:05Z")

</div>

This topic was automatically closed after 5 days. New replies are no longer allowed.
