Tuto créer un système de FAQ sur shopify

Dans ce tutoriel nous allons voir comment créer un système de FAQ sur shopify en accordéon

Voiçi le code d’exemple à mettre dans votre éditeur pour proposer un système FAQ simple et efficace à mettre dans votre page FAQ !

Un exemple de ce que cela va donner:

You see? It’s curious. Ted did figure it out – time travel. And when we get back, we gonna tell everyone. How it’s possible, how it’s done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an ‘unknown entry event’? Why don’t they know? If they don’t know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic.

You see? It’s curious. Ted did figure it out – time travel. And when we get back, we gonna tell everyone. How it’s possible, how it’s done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an ‘unknown entry event’? Why don’t they know? If they don’t know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic.

You see? It’s curious. Ted did figure it out – time travel. And when we get back, we gonna tell everyone. How it’s possible, how it’s done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an ‘unknown entry event’? Why don’t they know? If they don’t know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic.

You see? It’s curious. Ted did figure it out – time travel. And when we get back, we gonna tell everyone. How it’s possible, how it’s done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an ‘unknown entry event’? Why don’t they know? If they don’t know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic.

Rendez vous sur votre page FAQ et dans votre éditeur passez en mode code avec l’icône </> et collez le code ci-dessous, repassez en mode normal et adaptez le selon votre convenance:

<style type="text/css">
.faq { 
 position: relative; 
}
.faq input { display: none; }
.faq input:checked + label { 
 background: -webkit-linear-gradient(top,#ccc,#ccc); 
 color: #000; 
 font-size:100%;
 font-weight: bold; 
}
.faq label { 
 font-family: helvetica;
 cursor: pointer; 
 display: block; 
 height: auto; 
 text-align: left; 
 padding:15px;
 padding-left:15px;
 margin:0;
 padding-right: 15px;

 color: #333; 
 font-size:100%; 
 border:1px solid #ddd;
 border-bottom: 0;
 font-weight: bold; 
 background: -webkit-linear-gradient(top,#eee,#ddd); 
}
.faq label:before {
 content:"+";
 line-height:21px;
 font-size:21px; 
 margin-right:5px; 
}
.faq input:checked + label:before {
 content:"-";
}
.faq label:last-child { margin-right: 0; }
.faq label:hover { 
 background: -webkit-linear-gradient(top,#eee,#ddd); 
}
.faq article { 
 max-height: 0;
 overflow: hidden; 
 transition: max-height 0.15s ease-out;
 position: relative; 
 margin-bottom: 0;
 top:0;
 padding:10px 10px 10px 10px; 
 color: #333; 
 opacity: 0;
 border:1px solid #ddd;
}
.faq div > input:checked ~ article { 
 max-height: 500px;
 opacity: 1;
 margin-bottom:12px;
 transition: max-height 0.25s ease-in; 
}​
</style> 
<form class="faq">
    <div class="faq-wrapper">
        <input type="radio" name="size" id="faq1" value="faq1" checked="checked" />
        <label for="faq1">Section 1</label>
        <article>
            <p>You see? It's curious. Ted did figure it out - time travel. And when we get back, we gonna tell everyone. How it's possible, how it's done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an 'unknown entry event'? Why don't they know? If they don't know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic.</p>
        </article>
    </div>
    <div class="faq-wrapper">
        <input type="radio" name="size" id="faq2" value="faq2" />
        <label for="faq2">Section 2</label>
        <article>
            <p>You see? It's curious. Ted did figure it out - time travel. And when we get back, we gonna tell everyone. How it's possible, how it's done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an 'unknown entry event'? Why don't they know? If they don't know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic.</p>
        </article>
    </div>
    <div class="faq-wrapper">
        <input type="radio" name="size" id="faq3" value="faq3" />
        <label for="faq3">Section 3</label>
        <article>
            <p>You see? It's curious. Ted did figure it out - time travel. And when we get back, we gonna tell everyone. How it's possible, how it's done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an 'unknown entry event'? Why don't they know? If they don't know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic.</p>
        </article>
    </div>
    <div class="faq-wrapper">
        <input type="radio" name="size" id="faq4" value="faq4" />
        <label for="faq4">Section 4</label>
        <article>
            <p>You see? It's curious. Ted did figure it out - time travel. And when we get back, we gonna tell everyone. How it's possible, how it's done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an 'unknown entry event'? Why don't they know? If they don't know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic.</p>
        </article>
    </div>
    <div class="faq-wrapper">
        <input type="radio" name="size" id="faq5" value="faq5" />
        <label for="faq5">Section 5</label>
        <article>
            <p>You see? It's curious. Ted did figure it out - time travel. And when we get back, we gonna tell everyone. How it's possible, how it's done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an 'unknown entry event'? Why don't they know? If they don't know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic.</p>
        </article>
    </div>
    <div class="faq-wrapper">
        <input type="radio" name="size" id="faq6" value="faq6" />
        <label for="faq6">Section 6</label>
        <article>
            <p>You see? It's curious. Ted did figure it out - time travel. And when we get back, we gonna tell everyone. How it's possible, how it's done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an 'unknown entry event'? Why don't they know? If they don't know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic.</p>
        </article>
    </div>
    <div class="faq-wrapper">
        <input type="radio" name="size" id="faq7" value="faq7" />
        <label for="faq7">Section 7</label>
        <article>
            <p>You see? It's curious. Ted did figure it out - time travel. And when we get back, we gonna tell everyone. How it's possible, how it's done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an 'unknown entry event'? Why don't they know? If they don't know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic.</p>
        </article>
    </div>
    <div class="faq-wrapper">
        <input type="radio" name="size" id="faq8" value="faq8" />
        <label for="faq8">Section 8</label>
        <article>
            <p>You see? It's curious. Ted did figure it out - time travel. And when we get back, we gonna tell everyone. How it's possible, how it's done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an 'unknown entry event'? Why don't they know? If they don't know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic.</p>
        </article>
    </div>
    <div class="faq-wrapper">
        <input type="radio" name="size" id="faq9" value="faq9" />
        <label for="faq9">Section 9</label>
        <article>
            <p>You see? It's curious. Ted did figure it out - time travel. And when we get back, we gonna tell everyone. How it's possible, how it's done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an 'unknown entry event'? Why don't they know? If they don't know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic.</p>
        </article>
    </div>
</form>

Vous savez désormais comment créer un système de FAQ sur shopify

Ps: si vous souhaitez rajouter des sections il vous suffira de dupliquer autant que vous le souhaitez l’élément input et article !

Bonne installation !

27 commentaires sur “Tuto créer un système de FAQ sur shopify

  1. Thomas

    Bonjour, merci beaucoup pour votre TUTO ! J’ai mis en place ce système, cependant quand j’ai voulu ajouter des sections en copiant le code depuis et entre les balises « div », les sections s’affichent mais ne s’ouvrent pas. Savez-vous comment puis-je faire pour remédier à cela ? Merci !

      1. dgeo22

        Bonsoir, en rajoutant une section comme ceci:

        You see? It's curious. Ted did figure it out - time travel. And when we get back, we gonna tell everyone. How it's possible, how it's done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an 'unknown entry event'? Why don't they know? If they don't know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic.

        1. mimi

          Bonjour Geoffrey, merci pour tout tes tutos, malheureusement, la dernière section ne fonctionnne pas chez moi non plus, en inspectant le code, je n’arrive pas à voir ce qui ne va pas 🙁

  2. Victor

    Salut Geoffrey, je voudrais ajouter des sections sur la page FAQ. J’ai copié ton code et essayé de changer les numéros pour arriver aux 5 sections que je souhaite avoir, mais ça marche pas soit elle ne s’ouvre pas soit elle s’incruste avec une autre section. Si tu veux bien m’aider n’hésite pas, je teremercie je fais partie de la formation shopify héros.

  3. MattCanada

    Salut Geo,
    pourrait tu crée la meme mais avec 9 section car j’essaie d’avoir acces a celle que tu as crée avec 5 sections mais elle ne fonctionne pas.
    Merci

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *

*
*