davn44 Posted March 17, 2017 Share Posted March 17, 2017 Bonjour, J'ai besoin d'un petit coup de main au sujet de la mise en forme de la description de mes articles en affichage Liste. voici le code exemple d'un article : <h3>Somaliland<br />1000 shillings</h3><p>Pick # : P-20c</p><p>Qual : Neuf / UNC</p><p>Date : 2014</p><p>BAANKA SOMALILAND</p> --> relativement basique il me semble La liste article me donne ceci (malgré les <p> qui a ma connaissance implique un retour à la ligne) : Somaliland1000 shillings Pick # : P-20c Qual : Neuf / UNC Date : 2014 BAANKA SOMALILAND --> c'est à dire, tout le texte à la queue leu leu... Comment faire, en css il me semble, pour avoir ce résultat : Somaliland1000 shillingsPick # : P-20cQual : Neuf / UNCDate : 2014BAANKA SOMALILAND Merci par avance de votre aide. Link to comment Share on other sites More sharing options...
BeComWeb Posted March 17, 2017 Share Posted March 17, 2017 Ce n'est pas un problème de CSS. Regarde du côté de la fonction display() du fichier global.js (themes/nom_de_ton_theme/js). Pour résumer quand tu switches de grille à liste il réorganise les infos à sa sauce sans tenir compte de ton markup Link to comment Share on other sites More sharing options...
davn44 Posted March 17, 2017 Author Share Posted March 17, 2017 Merci pour ta réponse. j'ai bien trouvé le code que tu mentionnes, mais j'avoue ne pas savoir comme fait là-dedans function display(view) { if (view == 'list') { $('ul.product_list').removeClass('grid').addClass('list row'); $('.product_list > li').removeClass('col-xs-12 col-sm-6 col-md-4').addClass('col-xs-12'); $('.product_list > li').each(function(index, element) { var html = ''; html = '<div class="product-container"><div class="row">'; html += '<div class="left-block col-xs-4 col-sm-5 col-md-4">' + $(element).find('.left-block').html() + '</div>'; html += '<div class="center-block col-xs-4 col-sm-7 col-md-4">'; html += '<div class="product-flags">'+ $(element).find('.product-flags').html() + '</div>'; html += '<h5 itemprop="name">'+ $(element).find('h5').html() + '</h5>'; var hookReviews = $(element).find('.hook-reviews'); if (hookReviews.length) { html += hookReviews.clone().wrap('<div>').parent().html(); } html += '<p class="product-desc">'+ $(element).find('.product-desc').html() + '</p>'; var colorList = $(element).find('.color-list-container').html(); if (colorList != null) { html += '<div class="color-list-container">'+ colorList +'</div>'; } var availability = $(element).find('.availability').html(); // check : catalog mode is enabled if (availability != null) { html += '<span class="availability">'+ availability +'</span>'; } html += '</div>'; html += '<div class="right-block col-xs-4 col-sm-12 col-md-4"><div class="right-block-content row">'; var price = $(element).find('.content_price').html(); // check : catalog mode is enabled if (price != null) { html += '<div class="content_price col-xs-5 col-md-12">'+ price + '</div>'; } html += '<div class="button-container col-xs-7 col-md-12">'+ $(element).find('.button-container').html() +'</div>'; html += '<div class="functional-buttons clearfix col-sm-12">' + $(element).find('.functional-buttons').html() + '</div>'; html += '</div>'; html += '</div></div>'; $(element).html(html); }); $('.display').find('li#list').addClass('selected'); $('.display').find('li#grid').removeAttr('class'); $.totalStorage('display', 'list'); } else { $('ul.product_list').removeClass('list').addClass('grid row'); $('.product_list > li').removeClass('col-xs-12').addClass('col-xs-12 col-sm-6 col-md-4'); $('.product_list > li').each(function(index, element) { var html = ''; html += '<div class="product-container">'; html += '<div class="left-block">' + $(element).find('.left-block').html() + '</div>'; html += '<div class="right-block">'; html += '<div class="product-flags">'+ $(element).find('.product-flags').html() + '</div>'; html += '<h5 itemprop="name">'+ $(element).find('h5').html() + '</h5>'; var hookReviews = $(element).find('.hook-reviews'); if (hookReviews.length) { html += hookReviews.clone().wrap('<div>').parent().html(); } html += '<p itemprop="description" class="product-desc">'+ $(element).find('.product-desc').html() + '</p>'; var price = $(element).find('.content_price').html(); // check : catalog mode is enabled if (price != null) { html += '<div class="content_price">'+ price + '</div>'; } html += '<div itemprop="offers" itemscope itemtype="https://schema.org/Offer" class="button-container">'+ $(element).find('.button-container').html() +'</div>'; var colorList = $(element).find('.color-list-container').html(); if (colorList != null) { html += '<div class="color-list-container">'+ colorList +'</div>'; } var availability = $(element).find('.availability').html(); // check : catalog mode is enabled if (availability != null) { html += '<span class="availability">'+ availability +'</span>'; } html += '</div>'; html += '<div class="functional-buttons clearfix">' + $(element).find('.functional-buttons').html() + '</div>'; html += '</div>'; $(element).html(html); }); $('.display').find('li#grid').addClass('selected'); $('.display').find('li#list').removeAttr('class'); $.totalStorage('display', 'grid'); } } un coup de mains serait le bienvenu. 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