sGallery for Evolution CMS 3
sGallery Plugin for attaching Images and Video clips (YouTube) to a resource in the Evolution CMS admin panel.
Features
- Upload Images.
- Upload Videos.
- Include Youtube.
- Sort positions.
- Text fields for file.
- Resize and WEBP convert image.
- Integration the gallery to custom modules.
Install by artisan package installer
Run in you /core/ folder:
php artisan package:installrequire seiger/sgallery "*"
Create config file in core/custom/config/cms/settings with name sgallery.php the file should return a comma-separated list of templates.
php artisan vendor:publish --provider="Seiger\sGallery\sGalleryServiceProvider"
Run make DB structure with command:
php artisan migrate
Configure
Templates for displaying gallery tabs are configured in the
core/custom/config/cms/settings/sGallery.php
file, where the array contains template IDs for connecting the gallery.
Usage in blade
Sow all files:
@foreach(sGallery::all() as $item)
<a class="swiper-slide" @if(trim($item->link))href="{{$item->link}}"@endif>
<div class="container">
<img loading="lazy" class="intro__img" src="{{$item->file_src}}" alt="{{$item->alt}}" width="1440" height="456">
<div class="intro__inner">
<div class="h1__title">{{$item->title}}</div>
<p class="intro__text">{{$item->description}}</p>
@if(trim($item->link_text))<div class="btn background__mod">{{$item->link_text}}</div>@endif
</div>
</div>
</a>
@endforeach
or
@foreach(sGallery::all('product', $product->id) as $item)
<div class="swiper-slide">
<a class="js-trigger-fancybox" href="{{$item->file_src}}" data-fancybox="product-gallery">
<img loading="lazy" src="{{$item->file_src}}" width="440" height="440" />
</a>
</div>
@endforeach
Integration into the products module
Just paste this code in your View backend
{!! sGallery::initialise('section', 'product', 'i') !!}