Hi all,
I selected 4 photos from my “Images” database.
Now, i would like select a different fitmode (‘fit’ for vertical images and ‘fixedwidth’ for horizontal images.)
I have a field (named HV) with a value of h (horizontal) and v (vertical).
What can I do? I thought about using foreachitem, but I can’t implement it.
This is my code:
$w . onReady (() => {
let galpicture = $w ( “#dynamicDataset” ). getCurrentItem ();
$w . onReady ( function () {
$w ( “#repeater1” ). onItemReady ( ( $item , itemData , index ) => {
$item ( “#image1” ). src = itemData . Photoimage ;
$item ( “#text1” ). text = itemData . title ;
} );
wixData . query ( “Images” )
. contains ( “gallery” , galpicture . gallery )
. ne ( “title” , galpicture . title )
. ascending ( “photoOrder” )
. limit ( 4 )
. find ()
. then ( ( results ) => {
$w ( “#repeater1” ). data = results . items ;
});
});
});
Many thanks for considering my request.
Stefano