Hey there,
Actually, yes, you can display two different galleries on your dynamic dataset, you’ll either need two datasets (which can slow down the page), or populate the galleries with code (if you’re into that).
Using a query, get the items from the database, filter them then assign them to the items property of the gallery
import wixData from 'wix-data';
$w.onReady(() => {
getItems().then((result) => {
$w('#customGallery').items = result.custom;
$w('#gallery').items = result.other;
})
})
function getItems() {
return wixData.query('collection').find().then((x) => {
const items = x.items;
const custom = items.filter(items => items.customHome === true);
const other = items.filter(items => items.customHome !== true);
return {
custom: custom,
other: other
}
})
}