Page Properties for Gallery Components

__SELF__.gallery (in overridden component template) or componentAlias.gallery (in a CMS page)
Type: ZenWare\NovemberGallery\Classes\Gallery
Gallery class, holds the various properties of the gallery instance.

Property Type Description
type string Gallery type (indicates how the images were upladed & where they are stored), possible values are: NOVEMBER_GALLERY, OCTOBER_MEDIA_MANAGER_FOLDER, BLOG_POST
folder string
Folder where the images can be found (available for galleries created using the OctoberCMS "Media Manager")
items October\Rain\Support\Collection Collection of gallery items, see below.
sortBy
string The GalleryItem property by which the gallery should be sorted (as set in the component inspector)
url
string
Gallery URL (only available for galleries in the "Gallery Hub" component)
name  string
Gallery name as set on the Gallery form for galleries uploaded using the "Galleries" back-end page, for galleries uploaded using the OctoberCMS Media Manager this is set to the folder name
slug
string
Gallery slug (available for galleries created on the "Galleries" back-end page)
description
string
Gallery description (available for galleries created on the "Galleries" back-end page)
keywords
string
Gallery keywords (available for galleries created on the "Galleries" back-end page)
publishedAt
Carbon datetime
Gallery published on date (available for galleries created on the "Galleries" back-end page)
createdAt
Carbon datetime
Gallery created on date (available for galleries created on the "Galleries" back-end page)
updatedAt
Carbon datetime
Gallery updated on date (available for galleries created on the "Galleries" back-end page)
previewImage
GalleryItem
Gallery preview image (available for galleries created on the "Galleries" back-end page)
published
boolean
Gallery active (or not) (available for galleries created on the "Galleries" back-end page)
sortBy
string
Gallery items sort order
sortDirection
string
Can be "ASC" or "DESC" (like in SQL)

 

GalleryItem Properties

__SELF__.galleryitems(in overridden component template) or componentAlias.galleryitems (in a CMS page)
Type: October\Rain\Support\Collection
also see API DocsIlluminate\Database\Eloquent\Collection and Illuminate\Support\Collection

Collection of ZenWare\NovemberGallery\Classes\GalleryItem classes. Serving it as a collection gives access to a ton functionality that is not available with a simple array. For example, you could choose to sort the images by filename:

{% for galleryitem in customGallery.gallery.items.sortBy('fileName') %}
   <img src="{{ galleryitem.url }}" />
{% endfor %}

 

Property Type Description
title string Image title metadata, available for images uploaded using the backend gallery page only
description string Description metadata, available for images uploaded using the backend gallery page only
sortOrder string Image sort order, available for images uploaded using the backend gallery page only
file SplFileInfo A standard php file information object, only available for files uploaded using the Media Manager
octoberImageFile System\Models\File A standard php file information object, only available for files uploaded using the Media Manager
width integer Image width, see https://www.php.net/manual/en/function.getimagesize.php
height integer Image height, see https://www.php.net/manual/en/function.getimagesize.php
type string Image type, see https://www.php.net/manual/en/function.getimagesize.php
orientation string Will be "horizontal", "vertical", or "square" depending on whether the image is wider than it is tall
fileNameWithoutExtension string Base name of the file without extension, for example: picture-1
fileExtension string File extension, for example: jpg
fileName string Filename, for example: picture-1.jpg
filePath string Path without filename, for example: /var/www/mywebsite.com/public_html/storage/app/media/my-galleries/gallery-1
fileRealPath string Absolute path to file, for example: /var/www/mywebsite.com/public_html/storage/app/media/my-galleries/gallery-1/picture-1.jpg
fileSize string File size, in bytes, for example: 404779
relativeFilePath string Path to file relative to the website, for example: /storage/app/media/my-galleries/gallery-1/picture-1.jpg
uploaded string Last modified time for files uploaded using the Media Manager, or the upload time for files uploaded using the back-end gallery tab, you can then: $currentTime->format( 'c' );
url string URL to file, for example: https://www.mywebsite.com/storage/app/media/my-galleries/gallery-1/picture-1.jpg

 

Hint: To dig into the galleryItems (or any other) variable/collection, you have two options. You can simply add {{ dump(embeddedGallery.galleryitems.toArray) }} on your page after the component definition and it will print debug information about that variable straight in your page. Learn more aboud dump in the official Twig docs. Note that "the dump function won’t display anything if the debug option on the environment is not enabled". To enable debug mode on your site, edit the app.php config file in your config directory. Learn more about debug mode in the OctoberCMS docs!

Alternatively, you can install the Debugbar plugin and then add {{ debug(embeddedGallery.gallery.items) }} to your page to show debug information in the Laravel debugbar. Make sure to replace "embeddedGallery" with the alias of your component as set in the component options!

 

Additional Page Properties for Gallery Components

(not applicable to the GalleryHub component)

__SELF__.defaultgalleryoptions
Type: string
Used in the embedded gallery default template, this holds any custom script options set for the component in the “Script Options” property, along with any generated options (for example: gallery_theme: "tiles", tiles_type: "justified")

__SELF__.defaultLightboxOptions
Type: string
Used in the lightbox gallery default template, this holds any custom script options set for the component in the “Script Options” property, along with the following: gallery_theme: "lightbox"

__SELF__.customgalleryscript
Type: string
The “Custom Gallery Script” set on the plugin backend settings page, if the “Custom Gallery Script” toggle switch is set to “ON”.

__SELF__.customlightboxscript
Type: string
The “Custom Lightbox Script” set on the plugin backend settings page, if the “Custom Lightbox Script” toggle switch is set to “ON”.

__SELF__.error
Type: string
If the plugin encounters an error, you can find the error description here.


Revision #9
Created Thu, Aug 22, 2019 8:40 AM by Lieszkovszky László
Updated Thu, Jul 9, 2020 9:25 AM by Lieszkovszky László