# Create fully custom header

**URL:** https://meta.discourse.org/t/create-fully-custom-header/70126
**Category:** Development
**Created:** [September 15, 2017, 3:29pm UTC](https://meta.discourse.org/t/create-fully-custom-header/70126 "2017-09-15T15:29:24Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![ganya](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ganya/32/120698_2.png) [@ganya](https://meta.discourse.org/u/ganya)
#### Post date: [September 15, 2017, 3:29pm UTC](https://meta.discourse.org/t/create-fully-custom-header/70126/1 "2017-09-15T15:29:24Z")

</div>

Hello guys. Is there any way to create fully custom header and do modifications with code.  
For example i need to move panel from header to list-controls container  
to make something like this ?

 ![Снимок-экрана-от-2017-09-15-18-18-55](https://global.discourse-cdn.com/meta/original/3X/6/a/6a6d5351aba2fe3fc64afb9349216f42bd50f5ac.jpg)

---

<div class="post-metadata">

### Author: ![ganya](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ganya/32/120698_2.png) [@ganya](https://meta.discourse.org/u/ganya)
#### Post date: [September 18, 2017, 7:52am UTC](https://meta.discourse.org/t/create-fully-custom-header/70126/2 "2017-09-18T07:52:05Z")

</div>

so no any suggestions ?

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [September 18, 2017, 8:04am UTC](https://meta.discourse.org/t/create-fully-custom-header/70126/3 "2017-09-18T08:04:05Z")

</div>

These kinds of changes usually require a custom plugin.

If you’ve never built a Discourse plugin before, here’s a guide to get started:

> [@Developing Discourse Plugins - Part 1 - Create a basic plugin](https://meta.discourse.org/t/beginners-guide-to-creating-discourse-plugins-part-1/30515):
>
> Building a plugin in Discourse can be really simple, once you learn a couple of quirks. The goal of this post is to create a skeleton plugin and introduce you to the basics. Your development environment Make sure you have a development environment of Discourse running on your computer. I recommend you use [the appropriate setup guide](https://meta.discourse.org/tag/dev-install) and come back when you’re done. plugin.rbtada Use [GitHub - discourse/discourse-plugin-skeleton: Template for Discourse plugins · GitHub](https://github.com/discourse/discourse-plugin-skeleton) to create a complete di…

If you’re stuck on a more concrete problem, I’m sure you’ll get an answer here 🙂

Alternatively, if you don’t want to build the plugin yourself, you can also create a topic with your budget in #Marketplace.

---

<div class="post-metadata">

### Author: ![ganya](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ganya/32/120698_2.png) [@ganya](https://meta.discourse.org/u/ganya)
#### Post date: [September 18, 2017, 8:42am UTC](https://meta.discourse.org/t/create-fully-custom-header/70126/4 "2017-09-18T08:42:51Z")

</div>

I need a plugin to move some html code ??? This is ridiculous

---

<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: [September 18, 2017, 9:00am UTC](https://meta.discourse.org/t/create-fully-custom-header/70126/5 "2017-09-18T09:00:06Z")

</div>

You can try something like this to start:

```
.panel.clearfix {top: 65px;}
#create-topic {margin-right: 130px;}

```

but you will need to test all the resolutions of the most used devices and adjust the css with the media queries and foresee all situations where a user might have problems.

![D97Gnex](https://global.discourse-cdn.com/meta/original/4X/b/a/b/bab2752b45b8b6f01aeb677694b93950fad79a44.png)  
(that’s why @fefrei told you to write a plugin, generally it is more maintenanceable)

---

<div class="post-metadata">

### Author: ![ganya](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ganya/32/120698_2.png) [@ganya](https://meta.discourse.org/u/ganya)
#### Post date: [September 18, 2017, 9:02am UTC](https://meta.discourse.org/t/create-fully-custom-header/70126/6 "2017-09-18T09:02:46Z")

</div>

not a good idea. i need to move element from header, and make .d-header { display:none }

---

<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: [September 18, 2017, 9:05am UTC](https://meta.discourse.org/t/create-fully-custom-header/70126/7 "2017-09-18T09:05:52Z")

</div>

What is the purpose of making the entire header invisible if I can ask?

---

<div class="post-metadata">

### Author: ![exetico](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/exetico/32/119962_2.png) [@exetico](https://meta.discourse.org/u/exetico)
#### Post date: [September 18, 2017, 9:07am UTC](https://meta.discourse.org/t/create-fully-custom-header/70126/8 "2017-09-18T09:07:59Z")

</div>

I’ll recommend you to think about your language 🙂

Discourse isn’t just plain HTML and CSS. Your request will change how the normally structure is build, as far as i know. So that’s why people recommend you to make a plugin. You could also look into a theme-solution, but i would not recommend that for that kind of changes 🙂

Update: Fixed typos. My keyboard isn’t happy about the English lang.

---

<div class="post-metadata">

### Author: ![ganya](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ganya/32/120698_2.png) [@ganya](https://meta.discourse.org/u/ganya)
#### Post date: [September 18, 2017, 9:09am UTC](https://meta.discourse.org/t/create-fully-custom-header/70126/9 "2017-09-18T09:09:08Z")

</div>

cause i need to insert another custom header

 ![Снимок экрана от 2017-09-18 12-08-20](https://global.discourse-cdn.com/meta/original/3X/d/4/d4a9962d2f5ae941e020d7af6d924de4eec14136.png)

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [September 18, 2017, 9:16am UTC](https://meta.discourse.org/t/create-fully-custom-header/70126/10 "2017-09-18T09:16:23Z")

</div>

Do you really need to _replace_ the existing header? If you’re fine with adding an _additonal_ header (line) on top, things get _way_ easier. You can get something like this up and running in a few minutes:

 ![image](https://global.discourse-cdn.com/meta/original/3X/7/8/786d69a8c9f18d20cb3dca763eeadea368f2e501.png)

---

<div class="post-metadata">

### Author: ![ganya](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ganya/32/120698_2.png) [@ganya](https://meta.discourse.org/u/ganya)
#### Post date: [September 18, 2017, 9:23am UTC](https://meta.discourse.org/t/create-fully-custom-header/70126/11 "2017-09-18T09:23:57Z")

</div>

Yes, I actually already do this. But my problem is not going anywhere. I need to move user panel right after the ‘new topic’ button. I can do this like @Trash say, but i think absolute positioning is not good way, because on another pages, this panel will be just floating in free space

 ![Снимок экрана от 2017-09-18 12-18-39](https://global.discourse-cdn.com/meta/original/3X/0/0/005bfc997d66e4d4f90db302b7901ff18344d900.png)

---

<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: [September 18, 2017, 9:38am UTC](https://meta.discourse.org/t/create-fully-custom-header/70126/12 "2017-09-18T09:38:50Z")

</div>

Also consider hiding the discourse header means hide the title of the discussion (and eventually the category and tags) and moving the navigation menu outside the header means that a user has access to essential features only on the homepage.

Look for a way to integrate the two menus that do not involve making the discourse header invisible. Otherwise you could make your site really complicated to navigate.

Your custom menu is a dropdown menu?  
If it is not, you can enter the menu into the discourse header for example.

---

<div class="post-metadata">

### Author: ![alttext](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alttext/32/81278_2.png) [@alttext](https://meta.discourse.org/u/alttext)
#### Post date: [February 4, 2018, 1:08am UTC](https://meta.discourse.org/t/create-fully-custom-header/70126/13 "2018-02-04T01:08:37Z")

</div>

> [@zogstrip](#):
>
> I actually don’t think it’s a bug. The body is always supposed to be docked unless you use a custom header (which your example isn’t).

I am still having trouble understanding when “docked” gets applied as a class to the body. And so I feel like I am playing whack-a-mole with the various pages and display: none-ing everywhere. What is the best way to have a custom home page and hide it everywhere else? (reference: [https://community.mistyrobotics.io/](https://community.mistyrobotics.io/))

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [February 4, 2018, 1:48am UTC](https://meta.discourse.org/t/create-fully-custom-header/70126/14 "2018-02-04T01:48:34Z")

</div>

One way to do that is to hide / show the custom content on based on the url.

Something like this:

```plaintext
<script type="text/discourse-plugin" version="0.8.16">
    api.onPageChange((url) => {
        // hero hidden by default 
        $('#home-hero').hide()
        // if on homepage(s), show hero
        if (url === '/' || url === '/latest' || url === '/top' || url === '/categories') {
            $('#home-hero').show()
        }
    });
</script>

```

This works but is not ideal as it checks on every page change.
