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 912
Dependents: 1
Suggesters: 0
Security: 0
Stars: 12
Watchers: 5
Forks: 13
Open Issues: 1
Type:contao-bundle
Requires
- php: ^8.1
- contao/core-bundle: ^4.13 || ^5.0
Requires (Dev)
- contao/manager-plugin: ^2.0
- terminal42/contao-build-tools: dev-main
Conflicts
- contao/manager-plugin: <2.0 || >=3.0
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 themod_pageimage
ormod_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