@php $photos = json_decode(`+ feed.photo_path +`); if($photos) { $photo_count = count($photos); } @endphp @if($photos) @if(count($photos) > 0 && count($photos) < 2)
@foreach ($photos as $photo)
image
@endforeach
@elseif(count($photos) > 1 && count($photos) < 3)
@foreach ($photos as $photo)
image
@endforeach
@elseif(count($photos) > 2 && count($photos) < 4)
@foreach ($photos as $photo)
image
@endforeach
@elseif(count($photos) > 3 && count($photos) < 5)
@foreach ($photos as $photo)
image
@endforeach
@elseif(count($photos) > 4) @php $n = 4; // to get the 4th image if the image count is greater than 3 @endphp
@foreach ($photos as $key => $photo) @if (in_array($key, [0,1,2,3])) @if(($key + 1) % $n)
image
@else @endif @endif @endforeach
@endif @endif @if(`+ feed.video_path + `)
@endif @if(`+ feed.file_path + `)
@endif if(length > 1 && length < 3) { // Make a container element for the list listContainer = document.createElement('div'), // Make the list listElement = document.createElement('row'), // Set up a loop that goes through the items in listItems one at a time numberOfListItems = data.length, html = document.getElementsByTagName('body')[0].appendChild(listContainer); listContainer.appendChild(listElement); for (i = 0; i < numberOfListItems; ++i) { listItem = document.createElement('row'); listItem.innerHTML = `
image
`; listElement.appendChild(listItem); }; return html } if(length > 1 && length < 3) { objTo = document.getElementById('card-body'); for(var i = 0; i < data.length; i++) { html = `
image
`; }; return html; } $(newImage).append(`
image
`);