Is there a best practice how to integrate a lightbox in TYPO3? Shall I use an extension?
TYPO3 has prepared the integration for you. In the TYPO3 Constant Editor (Module Template) you have the possibility to activate lightbox:
Now you are able to integrate any lightbox JS you like. Download JS and CSS files and add it in the PAGE TypoScript (into the footer for performance issues):
page.includeJSFooterlibs.lightbox = location/to/lightbox/js/file.js
page.includeCSS.lightbox = location/to/lightbox/css/file.css
If you need to configure your lightbox, add your own JS file:
page.includeJSFooter.script = location/to/own/config/js/file.js
Finally, you only need to set the option Enlarge on click
whenever you add media to a content element: