@php
- $text=$slot;
- $enabled=true;
- if(isset($data) && is_array($data)){
- if($data['type']=='none'){
- $enabled=false;
- } else if($data['type']=='external_link'){
- $href=$data['external_link'];
- }else if($data['type']=='internal_link'){
- $href='/'.ltrim($data['link'],'/');
- }else if($data['type']=='page_link'){
- $href=\Cubist\Backpack\app\Magic\Menu\Menu::internalToHref($data['page_id']);
+ $text = $slot;
+ $enabled = true;
+ if (isset($data) && is_array($data)) {
+ if ($data['type'] == 'none') {
+ $enabled = false;
+ } else if ($data['type'] == 'external_link') {
+ $href = $data['external_link'];
+ } else if ($data['type'] == 'internal_link') {
+ $href = '/' . ltrim($data['link'], '/');
+ } else if ($data['type'] == 'page_link') {
+ $href = \Cubist\Backpack\app\Magic\Menu\Menu::internalToHref($data['page_id']);
}
- $text=$data['label'];
+ $text = $data['label'];
}
@endphp
{{-- Product Grid --}}
<grid cols="auto" class="products-grid">
- @foreach($related as $id=>$rel)
- @include('partials.product-link',['id'=>$id,'product'=>$rel])
+ @foreach($related as $id => $rel)
+ @include('partials.product-link', ['id' => $id, 'product' => $rel])
@endforeach
</grid>
{{-- Product Grid --}}
<grid cols="auto" class="products-grid">
- @foreach($related as $id=>$rel)
- @include('partials.product-link',['id'=>$id,'product'=>$rel])
+ @foreach($related as $id => $rel)
+ @include('partials.product-link', ['id' => $id, 'product' => $rel])
@endforeach
</grid>
{{-- Product Grid --}}
<grid cols="auto" class="products-grid mt-6">
- @foreach($products as $id=>$product)
- @include('partials.product-link',['id'=>$id,'product'=>$product])
+ @foreach($products as $id => $product)
+ @include('partials.product-link', ['id' => $id, 'product' => $product])
@endforeach
</grid>
</div>
$image = $page->getImageURL("$name.image",'',asset('storage/uploads/images/products-intro.jpg'));
$class = $class ?? '';
$padding = $padding ?? null; // Pass null so it doesn't override default padding
- $button=$page->get("$name.button");
+ $button = $page->get("$name.button");
@endphp
<full-width :padding="$padding" :class="$class">
<text-block class="pt-2v" title-class="h1 overlap-left" :title="$title">
<p>@markdown($page->get("$name.text"))</p>
- <p><link-button :data="$button"/></p>
+ @if ($button)
+ <p><link-button :data="$button"/></p>
+ @endif
</text-block>
</column>
</columns>
<div data-product-id="{{$id}}" class="product-grid-item bg-grey-200">
{{-- Image holder --}}
- <a href="{{ $product->URL }}">
+ <a href="{{ $product->getEntity()->URL }}">
<div class="product-img-holder">
<div class="product-img"
style="background-image: url({{ $product->getEntity()->image }})"></div>
{{-- Product details --}}
<div class="p-4">
- <h3><a class="text-navy" href="{{ $product->URL }}">{{ $product->get('reference') }}</a>
+ <h3><a class="text-navy" href="{{ $product->getEntity()->URL }}">{{ $product->get('reference') }}</a>
</h3>
<div class="product-highlights text-sm">
{{$product->get('name')}}
</div>
<p class="mt-4">
- <a href="{{ $product->URL }}">
+ <a href="{{ $product->getEntity()->URL }}">
{{ __('Voir la fiche produit') }}
</a>
</p>