Documentation
Kitchen Sink documentation of style: 'Delos' of skin: 'ILIAS'
Lightbox Image Page
Description
- Purpose
- A Lightbox image page represents an image inside a Lightbox modal.
- Composition
- The page consists of the image, a title and optional description.
- Effect
- The image is displayed in the content section of the Lightbox modal and the title is used as modal title. If a description is present, it will be displayed below the image.
Rules
- Usage
- A Lighbox image page MUST have an image and a short title.
- A Lightbox image page SHOULD have short a description, describing the presented image. If the description is omitted, the Lightbox image page falls back to the alt tag of the image.
Example 1: Show a single image
<?php declare(strict_types=1); namespace ILIAS\UI\examples\Modal\LightboxImagePage; function show_a_single_image() { global $DIC; $factory = $DIC->ui()->factory(); $renderer = $DIC->ui()->renderer(); $image = $factory->image()->responsive("src/UI/examples/Image/mountains.jpg", "Image source: https://stocksnap.io, Creative Commons CC0 license"); $page = $factory->modal()->lightboxImagePage($image, 'Mountains'); $modal = $factory->modal()->lightbox($page); $button = $factory->button()->standard('Show Image', '') ->withOnClick($modal->getShowSignal()); return $renderer->render([$button, $modal]); }
Example 2: Show multiple images
<?php declare(strict_types=1); namespace ILIAS\UI\examples\Modal\LightboxImagePage; function show_multiple_images() { global $DIC; $factory = $DIC->ui()->factory(); $renderer = $DIC->ui()->renderer(); $image = $factory->image()->responsive('src/UI/examples/Image/mountains.jpg', 'Nice view on some mountains'); $page = $factory->modal()->lightboxImagePage($image, 'Mountains', 'Image source: https://stocksnap.io, Creative Commons CC0 license'); $image2 = $factory->image()->responsive('src/UI/examples/Image/sanfrancisco.jpg', 'The golden gate bridge'); $page2 = $factory->modal()->lightboxImagePage($image2, 'San Francisco', 'Image source: https://stocksnap.io, Creative Commons CC0 license'); $image3 = $factory->image()->responsive('src/UI/examples/Image/ski.jpg', 'Skiing'); $page3 = $factory->modal()->lightboxImagePage($image3, 'Ski Fun', 'Image source: https://stocksnap.io, Creative Commons CC0 license'); $modal = $factory->modal()->lightbox([$page, $page2, $page3]); $button = $factory->button()->standard('Show some fancy images', '') ->withOnClick($modal->getShowSignal()); return $renderer->render([$button, $modal]); }
Relations
- Parents
- UIComponent
- Modal