wonmew
(Eric)
December 27, 2019, 5:37pm
1
I want to add a banner on my homepage, not by using the banner topic , because I want to add background image, text, or button.
A very common situation you’ll find yourself in as a theme developer is the need to create content that only shows on the homepage of your community.
You might add some HTML to the “After Header” section of your theme, which will then appear on every page. You can jump through some hoops in CSS to hide this everywhere except the homepage… but instead let’s use a Discourse theme to create a component with content that is only visible on your homepage.
If you’re unfamiliar with Discourse themes …
I followed this topic tried put the first part code into my </head>
then add the rest part to After Header tab, but there is not effect. am I doing something wrong? can I add a customer banner or 2 banners just on my homepage?
1 Like
hawm
(Hawm)
December 27, 2019, 6:10pm
2
Yes, you may do something wrong but we cant know that because you didnt show any additional info.
1 Like
wonmew
(Eric)
December 27, 2019, 6:22pm
3
this is the code I added in my After Header
<script type="text/x-handlebars" data-template-name="/connectors/below-site-header/custom-
homepage">
{{#if displayCustomHomepage}}
<div class="custom-homepage-wrapper wrap">
<h1>I am John Doe</h1>
<p>And I'm a Photographer</p>
</div>
</div>
</div>
{{/if}}
</script>
if I just add <h1>I am John Doe</h1> <p>And I'm a Photographer</p>
it shows on the top, but not just homepage, it shows every page
1 Like
dax
(Daniela)
December 27, 2019, 7:20pm
4
Please, use the search function before posting.
Incidentally, the Versatile Banner has also the function you need.
5 Likes
JimPas
December 27, 2019, 8:57pm
5
You can also check out this link (which is contained in the topic of Daniela’s link above).
Hello,
I have an issue : I want a specific banner on the homepage only.
I saw that it was possible but I don’t find any subject resolving my problem. Maybe, the fact that I’m still in trial is a factor.
Can you help me please ?
1 Like
All the code goes in the section not in the after header