Search code examples
typo3lightbox

How to do an integration of a lightbox in TYPO3?


Is there a best practice how to integrate a lightbox in TYPO3? Shall I use an extension?


Solution

  • TYPO3 has prepared the integration for you. In the TYPO3 Constant Editor (Module Template) you have the possibility to activate lightbox:

    lightbox configuration TYPO3 Backend

    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:

    How to activate lightbox in TYPO3 Backend