Component 6: Gallery Hub
This component loads a list of galleries without actually rendering any galleries. Use this if you wish to show a "hub" page with a link to all of your galleries.
For a good introduction to this component, please first check out the Demo Site.
[Component Inspector Options]
The following are available in the gallery inspector:
Property | Inspector Name | Description |
---|---|---|
hubType |
Hub Type |
Leave blank to show a hub of all galleries, or select one of the options to only show certain galleries.
|
sortBy |
Order By |
Possible values are:
Note: Gallery Slug, Gallery Description, and Published On only work for images uploaded using the Galleries page! |
maxItems |
Max Galleries | The maximum number of galleries to display (leave blank to show all) |
linkUrl |
Link URL | Set the URL of your galleries. Include the following placeholder, which will be replaced with the "slug" of your gallery: %slug%' |
openInNewTab |
Open in new tab? | Should the link open in a new tab or in the current one? |
visualization |
Display as |
Choose one of the presets, or "template" if you wish to define your own template, or "custom" if you will write your own Twig code to render the gallery links! Possible values are:
|
template |
Link Template | Choose "Set the Template Below" in "Display as" and set your template, tags such as %type%, %url%, %slug%, %folder%, %name%, %description%, %keywords%, %created_at%, %updated_at%, %preview_image_url% will be replaced with actual values. |
[Page Properties]
__SELF__.galleries
Type: October\Rain\Support\Collection
also see API Docs, Illuminate\Database\Eloquent\Collection and Illuminate\Support\Collection
Collection of matching galleries. Each item in the collection is an instance of the Gallery class (see above). For an explanation of the Gallery and GalleryItem class properties, see Page Properties.
__SELF__.dirs
Type: array of strings
This is the result of the File::directories() call that retrieves all subdirectories underneath your gallery root folder. Only populated when the "Hub Type" is set to "All Galleries".
__SELF__.hubType
Type: string
As set by the user in the component inspector, will be [ALL] if the user selected "All Galleries", or a keyword (which is used to limit the galleries shown)
__SELF__.keyword
Type: string
If the hub type is set to search by keywords, then this will be set to the selected keyword.
__SELF__.sortBy
Type: string
As set in the component inspector, can be one of: default
, title
, description
, slug
, publishedon
__SELF__.sortDirection
Type: string
As set in the component inspector, can be either "ASC" or "DESC"
__SELF__.maxItems
Type: int
Maximum number of galleries to show, as set in the component inspector
__SELF__.linkUrl
Type: string
Link URL template, as set in the component inspector. The placeholder %slug% will be replaced with the slug of the given gallery
__SELF__.openInNewTab
Type: boolean
As set in the component inspector
__SELF__.visualization
Type: string
How the galleries should be rendered, can be one of: default
(unordered list of preview images), titleOnly
(unordered list of gallery names), template
(use a custom template), custom
(no code is generated)
__SELF__.visualizationTemplate
Type: string
If "visualization" is set to "template", then the gallery items will be rendered using the template given here. The following placeholders are replaced with actual values:
%type% | Gallery type, can be NOVEMBER_GALLERY, OCTOBER_MEDIA_MANAGER_FOLDER, or BLOG_POST |
%url% | Gallery URL |
%slug% | Gallery slug* |
%folder% | Gallery description* |
%name% | Gallery name (or the folder name in case of galleries uploaded using the OctoberCMS media manager |
%description% | Gallery description* |
%keywords% | Gallery keywords* |
%created_at% | Gallery creation date* |
%updated_at% | Gallery last update date* |
%preview_image_url% | Preview image URL (if set)* |
%published% | Gallery is published or not* |
%preview_image_title% | Preview image title* |
%preview_image_description% | Preview image description* |
%preview_image_width% | Preview image width* |
%preview_image_height% | Preview image height* |
%preview_image_filename% | Preview image filename* |
%preview_image_filesize% | Preview image file size* |
%items_count% | Count of images |
No Comments