Download the PHP package bociancz/gallery-module without Composer

On this page you can find all versions of the php package bociancz/gallery-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package gallery-module

Gallery Module for AsgardCMS

Special Thanks

to Nicolas Widart for AsgardCMS

Installation

You can install Gallery module using composer: composer require bociancz/gallery-module

After the module is installed, you have to give yourself access in AsgardCMS (using Roles/Permissions). New Gallery item will appear in the Sidebar.

Prerequisites

Gallery module by default uses Bootstrap 4 grid system and img-fluid classes to render gallery thumbnmails. If your frontend theme does not use bootstrap, you can load bootstrap CSS from CDN https://getbootstrap.com/docs/3.3/getting-started/ (bootstrap JavaScript is not needed).
Alternatively, you can use your own blade template to render gallery or switch to the Bootstrap 3 template also provided with the library (see Advanced Usage)

Usage (basic)

You can use Gallery module administration to create galleries using photos uploaded through Media module. Each gallery will generate a short code snippet that you can copy and paste either into the blade template, or into any page or article (created for example using Page or Blog module).

Register Middleware

In order for the code snippet to be transformed into gallery HTML code, you need to register RenderGallery middleware to the routes you want gallery module to kick in.

This can be done globally by editing app/Http/Kernel.php file and adding \Modules\Gallery\Http\Middleware\RenderGallery::class into the $middlewareGroups web group (this way, gallery will automatically render in all web routes on frontend):

Gallery Frontend

Gallery module uses baguetteBox.js library (https://feimosi.github.io/baguetteBox.js/). BaguetteBox.js is a lightweight (3.2kB minified/gzipped) responsive CSS3 gallery with no extra dependencies (i.e. jQuery is not needed)

In order to get full frontend functionality running:

or you can use local assets provided with the module (see Advanced Usage)

Usage (advanced)

Alternative middleware registration

If you do not like using Gallery middleware globally for the whole website, you can apply gallery.render middleware alias selectively to the specific frontend routes in your application

Load frontend assets locally (not from CDN)

if you are not a fan of loading frontend assets from CDN, you can use local copy provided with the Gallery module for convenience:

Customize Gallery look

Gallery module has several pre-loaded templates. By default, it will use simple bootstrap-based template with gallery JavaScript plugin baguetteBox.js (no jQuery neded), located in Modules/Gallery/Resources/views/frontend/bootstrap4-baguettebox.blade.php. There are several ways of changing this this default behavior:

Module Settings

you can go into the Gallery module Settings in admin interface, and enter one of the example gallery templates into the "Default Template" field. Current options are plain (simple display of img tags), plain-links (simple image tags, links open to new tab/window) or bootstrap4-baguettebox / bootstrap3-baguettebox (Bootstrap 4 or 3 and BaguetteBox.js based responsive template with lightbox - Bootstrap 4 is also a default option)

Custom single default template

you can create your own gallery template in Theme/YourTheme/view/partials/gallery.blade.php. If Gallery module finds a file in this location, it will automatically use it instead of the default one. Feel free to copy contents of one of the the module-provided samples to get an idea about what the file may look like. There are several examples in the Modules/Gallery/Resources/views/frontend directory

The simplest gallery template example would be something like this:

but you can of course override the file as you like. You have $gallery variable available in the template, which is an instance of Modules\Gallery\Entities\Gallery class.

Custom template in the shortcode

you can also provide your own custom gallery template by manually tweaking the gallery shortcode. Standard simple gallery shortcode looks like this [[GALLERY(gallery_name)]]. It is kind of like a GALLERY() function with a single parameter (gallery_name).

You can also provide a second parameter template_name. If you do, the module will use it instead of the default.

The shortcode will then look like this [[GALLERY(gallery_name,template_name)]], where template_name is name of your template, relative to your active frontend Theme using dot notation.

For example, shortcode [[GALLERY(my-gallery,galery.homepage.lightbox)]] will load gallery named my-gallery, and it will use template located in Themes/{your frontend theme}/gallery/homepage/lightbox.blade.php

Resources


All versions of gallery-module with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
composer/installers Version ~1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bociancz/gallery-module contains the following files

Loading the files please wait ....