Info
Content

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:

  • title/ Gallery Title or Folder Name (default)
  • description/ Gallery Description
  • slug / Gallery Slug
  • publishedOn / Published On or Folder Creation Date

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:

  • default / Links with Preview Image
  • titleOnly / List of Links with Title Only
  • template / Set the Template Below
  • custom / Write your own Twig Code (links are not rendered)
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 DocsIlluminate\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:

 

 

 

No Comments
Back to top