Alejandro Posted October 7, 2022 at 11:31 AM Share Posted October 7, 2022 at 11:31 AM By default when you assign a photo to be the cover or logo for a listing, that photo is no longer included in the photo gallery. Using the filter hook below you can re-add those images back to the gallery so they are also shown there. Clickfwd\Hook\Filter::add('post_get_listing_detailpage_query', function($listing, $params) { foreach (['Cover', 'Logo'] as $function) { if (!isset($listing[$function])) continue; if ($listing[$function]['main_media']) { unset($listing['MainMedia']); } $listing['Media']['photo'][] = $listing[$function]; } return $listing; }); There's a bit of extra code there to ensure that if the photo is not only a cover or a logo, but also the main media, it also shows in the gallery in the detail page. Raymond Ringston, JoshLewis, n00bster and 1 other 4 Link to comment
Recommended Posts