wonmew
(Eric)
27 Dicembre 2019, 5:37pm
1
Voglio aggiungere un banner alla mia homepage, non usando il topic banner, perché desidero includere un’immagine di sfondo, del testo o un pulsante.
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 …
Ho seguito questo topic, ho inserito la prima parte del codice nella sezione <head> e il resto nella scheda “Dopo l’intestazione”, ma non ho ottenuto alcun effetto. Sto facendo qualcosa di sbagliato? È possibile aggiungere un banner personalizzato o due banner solo sulla mia homepage?
hawm
(Hawm)
27 Dicembre 2019, 6:10pm
2
Sì, potresti aver fatto qualcosa di sbagliato, ma non possiamo saperlo perché non hai fornito ulteriori informazioni.
wonmew
(Eric)
27 Dicembre 2019, 6:22pm
3
Questo è il codice che ho aggiunto nel mio 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>Sono John Doe</h1>
<p>E sono un fotografo</p>
</div>
</div>
</div>
{{/if}}
</script>
Se aggiungo solo <h1>Sono John Doe</h1> <p>E sono un fotografo</p>,
appare in alto, ma non solo nella homepage: viene mostrato in ogni pagina.
dax
(Daniela)
27 Dicembre 2019, 7:20pm
4
Per favore, usa la funzione di ricerca prima di pubblicare.
A proposito, anche Versatile Banner ha la funzione di cui hai bisogno.
JimPas
27 Dicembre 2019, 8:57pm
5
Puoi anche consultare questo link (che è contenuto nell’argomento del link di Daniela sopra).
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 ?
Tutto il codice va inserito nella sezione , non dopo l’intestazione