yann45110 Posted March 12, 2015 Share Posted March 12, 2015 Bonjour à toute la communauté! Bon je viens vous voir car je suis sous prestashop 1.6.0.11 et je voudrais integrer à mes pages produits un scrollspy comme sur le site ldlc par éxemple ou encore la becanerie. j'ai trouvé un code pour bootstrap mais alors je ne vois pas du tout comment integrer ce code à ma page product.tpl dans le sens ou le scroll spy concerne les data-sheet et le hook "product footer". Pourriez-vous m'aider? Merci à vous Link to comment Share on other sites More sharing options...
Alexandre Carette Posted March 12, 2015 Share Posted March 12, 2015 (edited) Salut, je me suis posé la question sur ce qu'était un scroll spy... j'ai trouvé ma réponse ici: http://getbootstrap.com/javascript/#scrollspy du coup j ai testé... je met ca dans mon global.css (ou meme product.css ca doit être mieu) .scrollspy-example { position: relative; height: 200px; margin-top: 10px; overflow: auto; } ensuite j'insere ce code dans mon product.tpl <div class="bs-example" data-example-id="embedded-scrollspy"> <nav id="navbar-example2" class="navbar navbar-default navbar-static"> <div class="container-fluid"> <div class="navbar-header"> <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target=".bs-example-js-navbar-scrollspy"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">Project Name</a> </div> <div class="collapse navbar-collapse bs-example-js-navbar-scrollspy"> <ul class="nav navbar-nav"> <li class=""><a href="#fat">@fat</a></li> <li class=""><a href="#mdo">@mdo</a></li> <li class="dropdown active"> <a href="#" id="navbarDrop1" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Dropdown <span class="caret"></span></a> <ul class="dropdown-menu" role="menu" aria-labelledby="navbarDrop1"> <li><a href="#one" tabindex="-1">one</a></li> <li class=""><a href="#two" tabindex="-1">two</a></li> <li class="divider"></li> <li class="active"><a href="#three" tabindex="-1">three</a></li> </ul> </li> </ul> </div> </div> </nav> <div data-spy="scroll" data-target="#navbar-example2" data-offset="0" class="scrollspy-example"> <h4 id="fat">@fat</h4> <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> <h4 id="mdo">@mdo</h4> <p>Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard. Freegan beard aliqua cupidatat mcsweeney's vero. Cupidatat four loko nisi, ea helvetica nulla carles. Tattooed cosby sweater food truck, mcsweeney's quis non freegan vinyl. Lo-fi wes anderson +1 sartorial. Carles non aesthetic exercitation quis gentrify. Brooklyn adipisicing craft beer vice keytar deserunt.</p> <h4 id="one">one</h4> <p>Occaecat commodo aliqua delectus. Fap craft beer deserunt skateboard ea. Lomo bicycle rights adipisicing banh mi, velit ea sunt next level locavore single-origin coffee in magna veniam. High life id vinyl, echo park consequat quis aliquip banh mi pitchfork. Vero VHS est adipisicing. Consectetur nisi DIY minim messenger bag. Cred ex in, sustainable delectus consectetur fanny pack iphone.</p> <h4 id="two">two</h4> <p>In incididunt echo park, officia deserunt mcsweeney's proident master cleanse thundercats sapiente veniam. Excepteur VHS elit, proident shoreditch +1 biodiesel laborum craft beer. Single-origin coffee wayfarers irure four loko, cupidatat terry richardson master cleanse. Assumenda you probably haven't heard of them art party fanny pack, tattooed nulla cardigan tempor ad. Proident wolf nesciunt sartorial keffiyeh eu banh mi sustainable. Elit wolf voluptate, lo-fi ea portland before they sold out four loko. Locavore enim nostrud mlkshk brooklyn nesciunt.</p> <h4 id="three">three</h4> <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p> <p>Keytar twee blog, culpa messenger bag marfa whatever delectus food truck. Sapiente synth id assumenda. Locavore sed helvetica cliche irony, thundercats you probably haven't heard of them consequat hoodie gluten-free lo-fi fap aliquip. Labore elit placeat before they sold out, terry richardson proident brunch nesciunt quis cosby sweater pariatur keffiyeh ut helvetica artisan. Cardigan craft beer seitan readymade velit. VHS chambray laboris tempor veniam. Anim mollit minim commodo ullamco thundercats. </p> </div> </div> chez moi le scroll spy marche je suis en 1.6... Edited March 12, 2015 by Alexandre-KM (see edit history) Link to comment Share on other sites More sharing options...
Alexandre Carette Posted March 12, 2015 Share Posted March 12, 2015 Reste à savoir maintenant ce que tu veux faire avec tes data sheet, l'affichage des features se trouve dans le product.tpl vers la ligne 452 {if isset($features) && $features} <!-- Data sheet --> <section class="page-product-box"> <h3 class="page-product-heading">{l s='Data sheet'}</h3> <table class="table-data-sheet"> {foreach from=$features item=feature} <tr class="{cycle values="odd,even"}"> {if isset($feature.value)} <td>{$feature.name|escape:'html':'UTF-8'}</td> <td>{$feature.value|escape:'html':'UTF-8'}</td> {/if} </tr> {/foreach} </table> </section> <!--end Data sheet --> {/if} Link to comment Share on other sites More sharing options...
yann45110 Posted March 12, 2015 Author Share Posted March 12, 2015 bin enfait, je vois pas ou insérer le code, ce que je veux, c'est que les onglets du menu soient repris sur chaque "ancre", avec l'onglets sur lequel on est en surbrillance. actuellement sur la page produit j'ai un data-sheet "fiche technique" le "en savoir plus" et les "avis". J'aimerais donc integrer un scroolspy pour que l'utilisateur puisse aller directement à la section de la page qu'il veut sans scroller. Mais je ne vois pas ou mettre le code que tu as mis plus haut (je veux dire au début, à la fin de product.tpl??) Link to comment Share on other sites More sharing options...
Alexandre Carette Posted March 16, 2015 Share Posted March 16, 2015 tu le met la ou tu veux afficher ton scrool spy, le pb c'est de faire rentrer les features et les avis dans ce code... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now