PHPackages                             markocupic/gallery-creator-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. markocupic/gallery-creator-bundle

ActiveContao-bundle[Utility &amp; Helpers](/categories/utility)

markocupic/gallery-creator-bundle
=================================

gallery extension for Contao CMS

3.3.6(3w ago)86.3k↓66.7%4[4 issues](https://github.com/markocupic/gallery-creator-bundle/issues)[1 PRs](https://github.com/markocupic/gallery-creator-bundle/pulls)1LGPL-3.0+PHPPHP ^8.3CI failing

Since Dec 25Pushed 6mo ago3 watchersCompare

[ Source](https://github.com/markocupic/gallery-creator-bundle)[ Packagist](https://packagist.org/packages/markocupic/gallery-creator-bundle)[ RSS](/packages/markocupic-gallery-creator-bundle/feed)WikiDiscussions 3.x Synced 2w ago

READMEChangelogDependencies (14)Versions (86)Used By (1)

[![Marko Cupic](docs/img/logo.svg)](docs/img/logo.svg)

Gallery Creator Bundle
======================

[](#gallery-creator-bundle)

[![Latest Version](https://camo.githubusercontent.com/59c5e4ddbd889b1df7edff3e802cc33c2c347d14737884274b7da67d39bd0b1f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61726b6f63757069632f67616c6c6572792d63726561746f722d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/markocupic/gallery-creator-bundle)[![Total Downloads](https://camo.githubusercontent.com/745f87b3933a4b362fcce0a5ddc2567d2e8ea23989cbc388f6ec78274985b4bf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d61726b6f63757069632f67616c6c6572792d63726561746f722d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/markocupic/gallery-creator-bundle)[![License](https://camo.githubusercontent.com/c5478ce3b3697ecf441e4b468a396c13cb097bfeef395a45fe9d0fe068e56a53/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d61726b6f63757069632f67616c6c6572792d63726561746f722d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://github.com/markocupic/gallery-creator-bundle/blob/3.x/LICENSE)

**Frontend and backend extension for [Contao CMS](https://www.contao.org).**

This extension lets you create, display and manage photo albums in your [Contao](https://www.contao.org) installation. It ships with an **album listing** and an **album detail view**, supports nested (child) albums, per-album access rights, and [Markdown](https://www.markdownguide.org/) album descriptions.

    Gallery.Creator.mp4    Table of contents
-----------------

[](#table-of-contents)

- [Requirements](#requirements)
- [Installation](#installation)
- [Upgrading](#upgrading)
- [Configuration](#configuration)
- [Access rights (CHMOD)](#access-rights-chmod)
- [Lightbox](#lightbox)
- [Styling (CSS)](#styling-css)
- [Frontend templates](#frontend-templates)
- [Extending the bundle](#extending-the-bundle)
    - [GenerateFrontendTemplateEvent](#generatefrontendtemplateevent)
    - [ImagePostInsertEvent](#imagepostinsertevent)
- [Running the tests](#running-the-tests)

Requirements
------------

[](#requirements)

- Contao `^5.3`
- PHP `^8.3`

Installation
------------

[](#installation)

Use the **Contao Manager** or run the following command in your CLI:

```
composer require markocupic/gallery-creator-bundle
```

Upgrading
---------

[](#upgrading)

> ⚠️ **Upgrading to 3.3.0?**This release contains **breaking changes** to the frontend Twig templates and **removes** the legacy `galleryCreatorGenerateFrontendTemplate` and `galleryCreatorImagePostInsert` hooks (replaced by Symfony events). Please read the [**UPGRADE.md**](UPGRADE.md) before updating, especially if you have customized any templates or used one of these hooks.

Configuration
-------------

[](#configuration)

The bundle ships with a default configuration. To override it, add your settings to your project configuration (e.g. `config/config.yaml`):

```
# config/config.yaml
# Gallery Creator (default settings)
markocupic_gallery_creator:
  upload_path: 'files/gallery_creator_albums'
  copy_images_on_import: true
  read_exif_meta_data: false
  valid_extensions: ['jpg', 'jpeg', 'gif', 'png', 'webp', 'svg', 'svgz']
```

Access rights (CHMOD)
---------------------

[](#access-rights-chmod)

Go to the **Contao backend settings** and select a default **album owner**, a default **album owner group** and the default **access rights**.

**Important:** If you leave the "album owner" field empty, the currently logged-in backend user automatically becomes the album owner when creating a new album.

[![chmod](docs/img/chmod.jpg)](docs/img/chmod.jpg)

Lightbox
--------

[](#lightbox)

As a lightbox we strongly recommend [Glightbox](https://biati-digital.github.io/glightbox/):

```
composer require inspiredminds/contao-glightbox
```

Make sure you have activated the lightbox template in the layout settings of your theme in the Contao backend.

Styling (CSS)
-------------

[](#styling-css)

Gallery Creator adds the `.gc-listing-view` and/or the `.gc-detail-view` class to the `` tag. This helps you show or hide items depending on the current mode (listing vs. detail view).

```
// SASS: do not display the content element headline in detail mode
body.gc-detail-view {
  .ce_gallery_creator {
    h2:not([class^="gc-album-detail-name"]) {
      display: none;
    }
  }
}
```

Frontend templates
------------------

[](#frontend-templates)

The frontend output is rendered with Contao Twig components. You can override any of the shipped templates in your project's `contao/templates/` directory:

- `content_element/gallery_creator.html.twig`
- `content_element/gallery_creator_news.html.twig`
- `component/_album.html.twig`
- `component/_album_detail_view.html.twig`
- `component/_album_list_view.html.twig`

> If you override these templates, be aware that the template variables changed in 3.3.0. See [UPGRADE.md](UPGRADE.md) for the details.

Extending the bundle
--------------------

[](#extending-the-bundle)

### GenerateFrontendTemplateEvent

[](#generatefrontendtemplateevent)

Use the `GenerateFrontendTemplateEvent` to adapt the frontend output. It is dispatched right before the gallery frontend template is rendered and carries the content element controller, the template, the current request and the active album (if there is one). Listeners mutate the template in place; no return value is expected.

> This replaces the in version 3.0.0 removed `galleryCreatorGenerateFrontendTemplate` hook (see [UPGRADE.md](UPGRADE.md)).

```
