Image block lightbox1 user found helpful
this is my first time with concrete5 - it's a very good and simple cms - the docs are great but I can't find:
How to enable lightbox for the image block?
:) Thank you!
Sorry, more informations:
- I use my own theme
- I use 5.7
the image block doesn't offer a popup functionality.
You can, however, insert an image in a content block, make it a link and choose to open the link in a popup
thank you for this information.
But to the core team:
Why there is no option to open the image in a lightbox when using image block?
Are there docs for it (e.g. how to integrate lightbox2)?
You can override the template of the "Image" block type, but getting your lightbox/popup plugin to work is priority #1. Then change the template to how it should be.
It is also a very solid one that works pretty much flawlessly.
I think I need to load it in my page_theme.php (register assets)?!
I think its core/lightbox
If you do it that way, the script will load on every page unless you write dome logic to select specific pages.
But since you are going to have to write a template for the image block anyway, to add settings for magnific popup, you can simply require the asset (the lightbox script) from the template itself.
Thank you very much!
The 'concrete5 Link'-plugin provides an image lightbox creation, which can be activated by choosing the 'lighbox'-Option in the Dropdown-Menu 'target' of the link attributes. This way clicking on the image opens a lightbox, which inspecting the created markup seems to rely on 'Magnific Popup' shipped with the concrete5-package.
Important: The 'lightbox'-Option is NOT in the dropdown of the link-option of the 'image'-plugin. You have to put the link on the image by clicking on the 'link'-icon in the text-editor-menu-bar. There you can find the 'lightbox'-Option (see screenshot in the file attached).
Being no programmer, I spent two days based on this thread trying to figure out a workaround for the missing lightbox-option in the core image block, and was already on the way to try 'copy-paste-image-block-to-packages-folder' + 'page_theme.php > requireAsset('core/lightbox') + 'code-analyzing-"finicking" in the copied image block'.
Happily enough this morning I came through the built-in-'lightbox'-Option in the content block, which saves me uncounted hours of 'coding-trials'.
So I thought to post this here for other people looking for information about built-in-lightbox-facilitiy in concrete5.