# Custom HTML on Groups page

**URL:** https://meta.discourse.org/t/custom-html-on-groups-page/140787
**Category:** Feature
**Created:** [5 februari 2020 om 21:38 UTC](https://meta.discourse.org/t/custom-html-on-groups-page/140787 "2020-02-05T21:38:20Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Fausto\_Dassenno](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fausto_dassenno/32/166480_2.png) [@Fausto\_Dassenno](https://meta.discourse.org/u/Fausto_Dassenno)
#### Post date: [5 februari 2020 om 21:38 UTC](https://meta.discourse.org/t/custom-html-on-groups-page/140787/1 "2020-02-05T21:38:20Z")

</div>

Hi all,  
I am designing a community where every user needs to ask permission to enter a group and every group is controlling the access to a category.  
I would like to add a welcome / explanation HTML to the groups’ page ( [https://community.horbitercafe.com/g](https://community.horbitercafe.com/g) )

What’s the easiest way to achieve this?

Thx

F.

---

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [5 februari 2020 om 21:44 UTC](https://meta.discourse.org/t/custom-html-on-groups-page/140787/2 "2020-02-05T21:44:02Z")

</div>

Not sure if this is the right plugin outlet but you can try this

In Customize \> `</head>`

Add this

```plaintext
<script type="text/x-handlebars" data-template-name="/connectors/before-group-container/plugin-outlet-component">

your html here

</script>

```

---

<div class="post-metadata">

### Author: ![Fausto\_Dassenno](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fausto_dassenno/32/166480_2.png) [@Fausto\_Dassenno](https://meta.discourse.org/u/Fausto_Dassenno)
#### Post date: [5 februari 2020 om 21:44 UTC](https://meta.discourse.org/t/custom-html-on-groups-page/140787/3 "2020-02-05T21:44:55Z")

</div>

How can I limit this to the /g page only?

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [5 februari 2020 om 22:08 UTC](https://meta.discourse.org/t/custom-html-on-groups-page/140787/4 "2020-02-05T22:08:39Z")

</div>

> [@Steven](#):
>
> Not sure if this is the right plugin outlet

Yes, that does indeed allow HTML to be “injected” above the Group Name and other information on pages at, e.g., [https://discourse.example.org/g/foo](https://discourse.example.org/g/foo). Thanks for sharing.

@Fausto_Dassenno are you looking at something for the main group listing page, but **not** the individual group detail page?

---

<div class="post-metadata">

### Author: ![Fausto\_Dassenno](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fausto_dassenno/32/166480_2.png) [@Fausto\_Dassenno](https://meta.discourse.org/u/Fausto_Dassenno)
#### Post date: [5 februari 2020 om 22:13 UTC](https://meta.discourse.org/t/custom-html-on-groups-page/140787/5 "2020-02-05T22:13:05Z")

</div>

Correct, I want to add HTML in the main group listing page only.

---

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [7 februari 2020 om 15:24 UTC](https://meta.discourse.org/t/custom-html-on-groups-page/140787/6 "2020-02-07T15:24:53Z")

</div>

Add a class to your html code, like gr-horbiter

```html
<script type="text/x-handlebars" data-template-name="/connectors/before-group-container/plugin-outlet-component">

<div class="gr-horbiter">
your html code
</div>

</script>

```

And add this css in common

```css
.gr-horbiter {
    display: none;
}

body.groups-page .gr-horbiter {
    display: block;
}

```

I didn’t test the code, but it should work

---

<div class="post-metadata">

### Author: ![Fausto\_Dassenno](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fausto_dassenno/32/166480_2.png) [@Fausto\_Dassenno](https://meta.discourse.org/u/Fausto_Dassenno)
#### Post date: [8 februari 2020 om 15:06 UTC](https://meta.discourse.org/t/custom-html-on-groups-page/140787/7 "2020-02-08T15:06:17Z")

</div>

Thanks @Steven, does the script part go in the html section of a component? Or do I need to edit the html directly ?

---

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [8 februari 2020 om 16:59 UTC](https://meta.discourse.org/t/custom-html-on-groups-page/140787/8 "2020-02-08T16:59:53Z")

</div>

Sorry I’m not sure I understand the question, english is not my first language, I can misunderstand a few things

You copy the script and html in the `</head>` section and add your welcome message, with some div or span if you want to customize it, and it should be good

---

<div class="post-metadata">

### Author: ![Fausto\_Dassenno](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fausto_dassenno/32/166480_2.png) [@Fausto\_Dassenno](https://meta.discourse.org/u/Fausto_Dassenno)
#### Post date: [8 februari 2020 om 21:04 UTC](https://meta.discourse.org/t/custom-html-on-groups-page/140787/9 "2020-02-08T21:04:35Z")

</div>

Thanks @Steven I had it working.  
Only issue is that I need this added in the group index page and not in the group detail page.  
At least now I got the logic behind this. I’ll research more.  
I cannot find any connector in the group index page.

---

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [8 februari 2020 om 21:26 UTC](https://meta.discourse.org/t/custom-html-on-groups-page/140787/10 "2020-02-08T21:26:54Z")

</div>

I should have tested, I now see what’s the issue 🤦‍♂️  
The plugin outlet doesn’t work for the group main page

I still have a way to add a banner but it’s probably not the cleanest way possible, Discourse staff might have a better way to do it.

This css code will allow you to add some text and stylind, but you’ll only have this class and I don’t think there’s a way to add a link in the text banner

```css
body.groups-page .groups-header::before {
    content: "Your text";
    width: 100%;
    margin: 0 0 15px 0;
}

```

You can add background, border, etc to customize the banner in this class to create the banner

---

<div class="post-metadata">

### Author: ![Fausto\_Dassenno](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fausto_dassenno/32/166480_2.png) [@Fausto\_Dassenno](https://meta.discourse.org/u/Fausto_Dassenno)
#### Post date: [8 februari 2020 om 23:53 UTC](https://meta.discourse.org/t/custom-html-on-groups-page/140787/11 "2020-02-08T23:53:33Z")

</div>

Thanks,  
I cannot achieve my goal with this. What I was trying to do was to create a landing page for groups so that new users could have requested access to the groups they wanted. In order to do this I wanted to give some explanations with some html.

How hard is to request a new outlet name in the groups index page?

---

<div class="post-metadata">

### Author: ![smrtey](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@smrtey](https://meta.discourse.org/u/smrtey)
#### Post date: [9 februari 2020 om 00:48 UTC](https://meta.discourse.org/t/custom-html-on-groups-page/140787/12 "2020-02-09T00:48:45Z")

</div>

If all you want is something like this it’s easy

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/0/f078c107c0f1748b3a2034252b324757319fdfd8.png)

```plaintext
.welcome-message {
    display:none;
}
.groups-page .welcome-message {
    display:block;
    margin: 20px;
}

```

Then add this to the After Header section

`<div class="welcome-message">Put your welcome info and instructions here</div>`

---

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [9 februari 2020 om 00:53 UTC](https://meta.discourse.org/t/custom-html-on-groups-page/140787/13 "2020-02-09T00:53:16Z")

</div>

Yeah, that’s easily the best solution

I’m complicating stuff sometimes 🤦‍♂️

---

<div class="post-metadata">

### Author: ![Fausto\_Dassenno](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fausto_dassenno/32/166480_2.png) [@Fausto\_Dassenno](https://meta.discourse.org/u/Fausto_Dassenno)
#### Post date: [9 februari 2020 om 21:45 UTC](https://meta.discourse.org/t/custom-html-on-groups-page/140787/14 "2020-02-09T21:45:17Z")

</div>

> [@smrtey](#):
>
> groups-page

Great, this works!  
What if I want to do the same but only showing only on homepage. What should I replace .groups-page with?

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [9 februari 2020 om 21:52 UTC](https://meta.discourse.org/t/custom-html-on-groups-page/140787/15 "2020-02-09T21:52:02Z")

</div>

Look at the class used in `body` in your html homepage.

For example here on [meta.discourse.org](http://meta.discourse.org):  
`<body class="navigation-topics" data-gr-c-s-loaded="true" style="" cz-shortcut-listen="true">`

The class used is `navigation-topics`.

---

<div class="post-metadata">

### Author: ![smrtey](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@smrtey](https://meta.discourse.org/u/smrtey)
#### Post date: [9 februari 2020 om 22:03 UTC](https://meta.discourse.org/t/custom-html-on-groups-page/140787/16 "2020-02-09T22:03:54Z")

</div>

Or if you want something fancier try

> [@Versatile Banner](https://meta.discourse.org/t/versatile-banner/109133):
>
> discourse2Summary Versatile Banner adds a customizable banner to your site.eyeglassesPreview [Preview on Discourse Theme Creator](https://discourse.theme-creator.io/theme/Discourse/versatile-banner)hammer_and_wrenchRepository Link [https://github.com/discourse/discourse-versatile-banner](https://github.com/discourse/discourse-versatile-banner)open_bookNew to Discourse Themes? [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) Install this theme component Features This theme component is an evolution of previous banner efforts. The goal is to provide more ease and flexibility through the use…

---

<div class="post-metadata">

### Author: ![Fausto\_Dassenno](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fausto_dassenno/32/166480_2.png) [@Fausto\_Dassenno](https://meta.discourse.org/u/Fausto_Dassenno)
#### Post date: [10 februari 2020 om 14:06 UTC](https://meta.discourse.org/t/custom-html-on-groups-page/140787/17 "2020-02-10T14:06:14Z")

</div>

Interesing, in my homepage I have this

![image](https://global.discourse-cdn.com/meta/original/3X/5/0/503b2ff0561874b2c61bd78c07f7ef0a550dbfce.png)

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [10 februari 2020 om 14:11 UTC](https://meta.discourse.org/t/custom-html-on-groups-page/140787/18 "2020-02-10T14:11:35Z")

</div>

What page is your homepage?

---

<div class="post-metadata">

### Author: ![Fausto\_Dassenno](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fausto_dassenno/32/166480_2.png) [@Fausto\_Dassenno](https://meta.discourse.org/u/Fausto_Dassenno)
#### Post date: [10 februari 2020 om 14:14 UTC](https://meta.discourse.org/t/custom-html-on-groups-page/140787/19 "2020-02-10T14:14:07Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/3X/b/1/b19d338e0dcb6145f79104e41096b01080b699ad.png)  
Is this what you are asking?

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [10 februari 2020 om 14:22 UTC](https://meta.discourse.org/t/custom-html-on-groups-page/140787/20 "2020-02-10T14:22:01Z")

</div>

I see what’s the issue is for your empty body class.  
Instead of looking at the page source, press F12 to show up the chrome/firefox/edge development tools and go to the “element” tab.  
Look at the HTML code from here and your `<body>` will show the right classes.

[Volgende pagina](https://meta.discourse.org/t/custom-html-on-groups-page/140787.md?page=2)
