Grid layout for XFRM without Addon

Grid layout for XFRM without Addon

This is a great bit of code - thank you! But I seem to lose my theme's color scheme when I use it, and some of the text gets cut off at the bottom of each resource. Here's a before and after screenshot.

BEFORE:


QAJnlKR.png


AFTER:

c5qzYW5.png
 
Well, I guess I should have read through this thread a bit more thoroughly - I just used the code from post #5 and things are much better! Thanks @Ehren!


3ndQIRj.png
 
Hello,
do you have grid layout for Forum list/nodes without addon?
I used to have this in xenforo 1 but now I can't find it without addon.
 
Hello,
do you have grid layout for Forum list/nodes without addon?
I used to have this in xenforo 1 but now I can't find it without addon.

There is this,

and this,
 
How can I get the reaction "Like" button in the grids? Not sure its possible but thought I would ask! Thanks!
 
Howdy,

may I ask, if this code addition works with the latest version of xfrm?
I added the code, and it did not change to grid view.
 
The icons (font awesome) aren't working fot me (a retangle is showing instead), but the grid layout is working fine.
Thank your guys!
 
Here is a fix for 2.3 (including FA Icons)

CSS:
@resource-grid-gap: 4px;
@resource-grid-width: 48%;
@resource-grid-thumb: 75px;

@media (min-width: @xf-responsiveMedium){
    @supports(display: grid){

        .block[data-type="resource"] .structItemContainer{
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(@resource-grid-width, 1fr));
            grid-gap: @resource-grid-gap;
            padding: @resource-grid-gap;
            background-color: @xf-contentAltBg;
        }
        .structItem--resource {
            background-color: @xf-contentBg;
            border-radius: 3px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            border-width: 0px;
            display: grid;
            grid-template-columns: @resource-grid-thumb 1fr;
            grid-template-areas: 'icon text' 'stats stats';

            .structItem-cell--icon.structItem-cell--iconExpanded{
                width: auto;
                grid-area: icon;
            }

           .structItem-title{
               white-space: normal;
          }

            .structItem-cell--main {
                grid-area: text;
                overflow: hidden;
            }

            .structItem-cell--resourceMeta {
                grid-area: stats;
                width: auto;
                display: flex;
                flex-wrap: wrap;
                align-items: center;
                justify-content: space-between;
            }

            .structItem-cell--iconExpanded .structItem-iconContainer .avatar {
                width: 100%;
                height: auto;
                font-size: 56px;
            }

            .structItem-secondaryIcon {
                display: none;
            }

            .structItem-metaItem--rating{
                flex: 1 0 100%;
            }

            .structItem-metaItem--downloads,
            .structItem-metaItem--lastUpdate{
                flex: 0 1 auto;
            }

            .ratingStarsRow--justified {
                border-bottom: 1px solid @xf-borderColorFaint;
                margin-bottom: 4px;
                padding-bottom: 4px;
            }
        }

    }
}

.structItem-metaItem--lastUpdate dt,.structItem-metaItem--downloads dt{
  font-size:0px; }
.structItem-metaItem--downloads dd{
  margin-left:18px; }
.structItem-metaItem--downloads dt:before ,.structItem-metaItem--lastUpdate dt:before {
    font-family: FontAwesome;
    font-size: 14px;
    position: absolute; }
.structItem-metaItem--downloads dt:before {
    margin-left: 0px;
   .m-faContent(@fa-var-download); }
.structItem-metaItem--lastUpdate dt:before {
  .m-faContent(@fa-var-clock);
  margin-left: -15px; }
 
Last edited:
Back
Top Bottom