In Custom Modules, how can I display list view in multiple columns (I am building with Foundation 6.5+) without repeating items multiple times? I am wanting a multi column view to display a large amount of items in a listing.
Hey @NotAndyLincoln I donāt really use Foundationās XY Grid, due to compatibility issues and overall bugginess, so I use the F6ās Flex Grid (Iād personally say the XY Grid is still a year out).
Anyways, when using Custom Modules, and if using F6 Flex Grid, do something like this:
<div class="row small-up-1 medium-up-2 large-up-3 align-center">
{% insert your custom module with "list" as the view %}
</div>
Then, inside your Custom Modules Layouts, in āListā or whatever you renamed it, add your:
<div class="columns">
<-- your own custom class and module list view content info -->
</div>
Alternatively you can run a liquid FORLOOP and achieve same thingā¦
<div class="row small-up-1 medium-up-2 large-up-3 align-center">
{% insert your custom module with layout "" as blank , and make sure to make it a collection object and add a collectionVariable %}
{% for item in [collectionVariableName].items %}
<div class="columns">
<-- your own custom class and module list view content info, just change this to item -->
</div>
{% endfor %}
</div>
Iāve just tried this on my site but no joy must be something Iām missing I have images coming up so all good with that but just as one line going down the page. so Iāve tried to add your coding so I have 3 images or four across the page but cant get it to work can you explain in more detail I have categorised
my images not sure if this is why.
Hi @Eddie and welcome!
Your CSS/HTML still needs to be setting the columns so they display as columns. The above code from Vlad just splits the data into āgroupsā and the code form Aaron utilises Foundations markup.
Are you using Foundation or any other CSS to format the columns?
If you can post a link Iād be happy to take a look.
Hi Adam
Thanks for the reply. All I`ve done is used one of the templates from treepl and set up a custom module Iāve got it working but as I said it just gives a single images going down the page. I was trying to get maybe 3 or 4 across the page with BC all you needed to do was add a number to their modules coding but with treepl trying to find out how it works is another process.
website is https://fibreglass-pools-melbourne.trialsite.co
In BC, it generated the markup for you (for Galleries), and from memory I think it used tables.
In Treepl we have the freedom to use our own custom markup.
But, for that template you are using, try wrapping your component tags in a div like this: