terminal42/contao-pageimage

[Contao CMS] Assign images to pages and output them on layout level using a frontend module.

Fund package maintenance!
terminal42
Other

Installs: 49 917

Dependents: 1

Suggesters: 0

Security: 0

Stars: 12

Watchers: 5

Forks: 13

Open Issues: 1

Type:contao-bundle

4.2.3 2024-11-20 08:34 UTC

This package is auto-updated.

Last update: 2024-12-20 08:53:20 UTC


README

This Contao extension add a new field to assign image files for each page. Using these images, the Page Image front end module can:

  • output the image as page content (e.g. as a header banner)
  • generate CSS to apply the image as a background to <body> or an element.

Note: In version 4, the two separate front end modules have been merged and the change from image to CSS happens through custom front end templates!

Features

  • Multiple images per page
    If more than one image is assigned to a page, the front end module can decide which n-th image should be shown. This means you can (for example) have a header and footer image per page. Make sure to correctly order them in the page configuration.

  • Inherit images from parent page
    If the current page has no image assigned, images from the parent page can optionally be inherited to all child pages.

  • Support for responsive images
    In both the mod_pageimage or mod_pageimage_background templates, Page Image fully supports Contao's responsive image settings (using <picture> or @media query respectively).

  • NEW: metadata support
    Version 4 adds support for file metadata. Same as with content elements, metadata can be defined in the file manager and can be selectively overridden in the page configuration.

Installation

Choose the installation method that matches your workflow!

Installation via Contao Manager

Search for terminal42/contao-pageimage in the Contao Manager and add it to your installation. Apply changes to update the packages.

Manual installation

Add a composer dependency for this bundle. Therefore, change in the project root and run the following:

composer require terminal42/contao-pageimage

Depending on your environment, the command can differ, i.e. starting with php composer.phar … if you do not have composer installed globally.

Then, update the database via the contao:migrate command or the Contao install tool.

License

This bundle is released under the MIT license