0

Morning, fine folks! I am having a beast of time with a newly discovered issue in my layout. I've tried everything that I know to do, to no avail. I know the answer must be a simple one, but darned if I can figure it out.

I have a product page (using Exp:resso Store) that I'm attempting to update with a new design to match the rest of the website. I'm using THIS grid.css (that someone, either from here or the EE forums, povided me with), and while it works beautifully for my categories page (which has this brand new layout applied to it), it's not working for the product listings page:

.section {
    clear: both;
    padding: 0px;
    margin: 0px;
}

/*  GROUPING  ============================================================================= */


.group:before,
.group:after {
    content:"";
    display:table;
}
.group:after {
    clear:both;
}
.group {
    zoom:1; /* For IE 6/7 (trigger hasLayout) */
}

/*  GRID COLUMN SETUP   ==================================================================== */

.col2 {
    display: block;
    float:left;
    margin: 1% 0 1% 1.6%;
    text-align: center;
    background-color: #FFF;
    border-radius: .5em;
    height: 220px;
}

.col {
    display: block;
    float:left;
    margin: 1% 0 1% 1.6%;
    text-align: center;
}

.col:first-child { margin-left: 0; } /* all browsers except IE6 and lower */


/*  REMOVE MARGINS AS ALL GO FULL WIDTH AT 480 PIXELS */

@media only screen and (max-width: 480px) {
    .col { 
        margin: 1% 0 1% 0%;
    }
}

/*  GRID OF FOUR   ============================================================================= */

.span_4_of_4 {
    width: 100%;
}

.span_3_of_4 {
    width: 74.6%; 
}

.span_2_of_4 {
    width: 49.2%; 
}

.span_1_of_4 {
    width: 23.8%; 
}


/*  GO FULL WIDTH AT LESS THAN 480 PIXELS */

@media only screen and (max-width: 480px) {
    .span_4_of_4 {
        width: 100%; 
    }
    .span_3_of_4 {
        width: 100%; 
    }
    .span_2_of_4 {
        width: 100%; 
    }
    .span_1_of_4 {
        width: 100%; 
    }
}

And here is the code on the page for it:

{exp:store:search orderby="category" sort="asc"}
{exp:store:product entry_id="{entry_id}"}

{if count %  4 == 1}
<div class="section group" reveal-fx="RevealFX17">
{/if}

<div class="col span_1_of_4">
<h2><a href="{url_title_path='shoppe/product'}">{title}</a></h2>
<p><img class="imgsm" src="{product_image}"></p>
<p>
{if on_sale}
<del>{regular_price}</del>
{price}
<span class="label label-success">Save {you_save} ({you_save_percent}%)</span>
{if:else}
{price}
{/if}
</p>
<p>
<a href="{url_title_path='shoppe/product'}" class="btn">Info/Purchase</a>
</p>
</div>

{if count %  4 == 0 || count == total_results}
</div>
{/if}

{/exp:store:product}
{/exp:store:search}

I've tried adding a linear conditional, changing the image sizes, removing the RevealFX, re-arranging the code, etc. None of this changes the fact that the page (found HERE) is displaying them stacked down the page instead of in rows of 4 products per row, which is what I'm going for. As far as I can see, there's no conflicting CSS, as it would render on the category page I created, so I'm stumped for sure. Advice appreciated! :) Thanks folks!

5
  • Shouldn't be {if count % 4 == 0}?
    – Sobral
    Oct 13, 2015 at 16:53
  • 1
    I'm voting to close this question as off-topic because it's about HTML. Ok, the template tags are closing the HTML wrong, but it's still a plain HTML issue.
    – Sobral
    Oct 13, 2015 at 16:54
  • This is off topic, and will probably be closed, but your answer is: set col class to be displaying as inline-block, remove the pseudo ::after selector on col (it's set to clear: both), and remove the margin on your form tags.
    – jrothafer
    Oct 13, 2015 at 18:15
  • My apologies for posting my ExpressionEngine HTML question in what I presumed to be the ExpressionEngine area. @ jrothafer - Thank you for taking a look & being kind about it. I did change that col piece to inline-block, and it didn't do anything. As for the ::after selector on col, and the form thing, neither of those are in the html, and none of this is a form, so I'm not sure where to begin with that. Thanks again, and have a great day!
    – C.A
    Oct 14, 2015 at 13:45
  • I'm leaving this open. I feel it's an EE question because the fix relates to how the EE count conditionals are written.
    – Anna_MediaGirl
    Oct 16, 2015 at 22:02

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.