Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By vladimirkomarek on
hi i am just trying to find out the easiest way to make a grid in my view
made by 3 columns in desktop mode (when the screen is big)
and just 1 column when the screen is small (mobile mode)
i've tried responsive grids but i cant make it work..
any other solution?
thanks
Comments
I assume you mean you tried
I assume you mean you tried the Fluid Grid module and it does not work?
If that is the case you are probably going have to build your own flexbox CSS for your view. Whilst it will need a little custom work, Google does find some code out there to get you started, for example https://github.com/13jupiters/ViewsFlexbox for Drupal 8 and the Backdrop FlexiViews Views plugin which will probably work on Drupal 7 with little or no adaptation.
Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors
are you sure
that fluid grid is about to make responsive grids on different media sizes?
Sorry, I have not used it.
Sorry, I have not used it. You may want to test it if the documentation does not answer the question.
You ask the 'easiest' way to make responsive grids. The easiest way is probably using CSS Grids. Of course you will have to write custom CSS. That is normal in Drupal. The reason you might not want to use the easiest method is that it currently has poor browser support.
Writing CSS using flexbox is easy if you already know the Flexible Block Layout, though flexbox a little complex to learn.
Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors
i have no problems with CSS
let's see if i can do that
the problem
is that is not friendly with all browsers
https://www.drupal.org
https://www.drupal.org/project/views_responsive_grid
did you use it?
i tried but i couldnt
test views_fluid_grid and you
test views_fluid_grid and you can have something like this http://golfershotels.it/golfer/en/search-hotel
well
this is not bad
Views Responsive Grid + Flexbox
As long as you are OK to use Flexbox you can easily create a responsive grid layout using the Responsive Grid format in Views. Make sure to use these settings:
... and add have these styles in your theme:
You will also need to give the columns a margin.
I recommend an autoprefixer for cross-browser compatibility, but this works well for me.
Note that in D8, the Responsive Grid format is in Core, but for D7 you will need this contrib module.
Bootstrap Grid
Did anybody has experience with Bootstrap Grid ?
That should do the responsive Grids. And everything else