return $this->image_fallback;
}
+ public function getImageAltAttribute()
+ {
+ if ($this->images) {
+
+ $image = $this->getFirstMediaAlt($this->images, '');
+
+ if ($image) {
+ return $image;
+ }
+ }
+
+ return $this->reference . ' - ' . $this->name;
+ }
+
public function getSearchShortTitle()
{
horizontal-spacing($horizontal-gutter)
width: 100%
+.bgimg
+ width 100%
+ height 100%
+ display inline
+ object-fit contain
+ object-position 50% 50%
+
+ .no-objectfit & {
+ height auto
+ }
+
+
// Overlapping content
$overlap-amount = 10vw
.products
// Grid view of products
+
&-grid
// When in auto grid mode, make the minimum width a bit
// larger so we end up with 3 cols at the largest size.
.links
white-space nowrap;
font-size 14px
+
.link
width 50%
white-space nowrap
overflow: hidden
li
- margin-bottom: 0 // avoids last line being partially cropped
+ margin-bottom: 0
+
+ // avoids last line being partially cropped
h3
height: 21px
@apply bg-white relative pb-100p
.product-img
- @apply absolute bg-contain bg-center bg-no-repeat
+ @apply absolute
+
width: 70%
height: 70%
top: 15%
left: 15%
+
+ img
+ width 100%
+ height 100%
+ display inline
+ object-fit contain
+ object-position 50% 50%
+
+ .no-objectfit & {
+ height auto
+ }
@foreach ($page->get('solutions', []) as $solution)
<a class="solutions-link" href="{{ $nav->getHrefByID($solution['page']) }}">
<div class="solutions-link-sizer"></div>
- <span class="solutions-link-bg"
- style="background-image:url({{ $page->getImageURLbyCollection($solution['image']) }})"></span>
+ <span class="solutions-link-bg">
+ <img src="{{ $page->getImageURLbyCollection($solution['image']) }}"
+ alt="{{ $page->getImageAltbyCollection($solution['image'],$solution['title']) }}"
+ class="bgimg"/>
+ </span>
<span class="solutions-link-text">{{ $solution['title'] }}</span>
</a>
@endforeach
href="{{ $nav->getHrefById('product_type/'.$highlight['link']) }}">
<div class="flex items-center justify-center flex-grow">
{{-- Proportional image holder --}}
- <div class="mb-4 bg-contain bg-no-repeat bg-center w-full"
- style="padding-bottom: 62%; background-image: url({{ $page->getImageUrlByCollection($highlight['image']) }})"></div>
+ <div class="mb-4 bg-contain bg-no-repeat bg-center w-full">
+ <img src="{{ $page->getImageUrlByCollection($highlight['image']) }}"
+ alt="{{$page->getImageAltByCollection($highlight['image'],$highlight['title'])}}" class="bgimg"/>
+ </div>
</div>
<p class="text-lg text-navy font-display font-medium">{{ $highlight['title'] }}</p>
</a>
{{-- Image holder --}}
<a href="{{ $product->getEntity()->URL }}">
<div class="product-img-holder">
- <div class="product-img"
- style="background-image: url({{ $product->getEntity()->image }})"></div>
+ <div class="product-img">
+ <img src="{{$product->getEntity()->image}}"
+ alt="{{$product->getEntity()->image_alt}}"/>
+ </div>
</div>
</a>
'css/cssgrid',
'css/flexbox',
'css/flexboxtweener',
+ 'css/objectfit',
]
}),
],