-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can we Use custom layout instead of just images ? #29
Comments
If you want to add more HTML, I recommend modifying However, the layout logic only allows for a visual gap and the images, so any text / buttons would need to be on top of them. Updating to also account for images next to text would be out of scope for this library. |
As it seems this requirement is quite common (ok, I admit that I have it too). So I fiddled around to find the best solution or at least several solutions to choose from. In any case I tried to avoid replacing the images with complete new elements (e.g. a div for the caption pus 1 image plus another div as footer...), but work with "overlays", title elements etc. Variant 1: use hooks to customize the properties of the 'ProgressiveImage' and modify the generated images or add new elements when creating the content of the <figure> tag. An example can be found on Stackblitz.
Disadvantages
Variant 2: enable using a custom 'ProgressiveImage' class via the config file (see pr #18
Disadvantages
Variant 3: As I like this idea, why not go one step further and update pig to ECMAscript classes? Any modern browser supports this (and for the rest we can use a bundler). I have made a demo for this on Stackblitz too (and have prepared an updated gulpfile with esbuild as a bundler to generate the umd file from the esm sources). Advantages
Disadvantages
I would appreciate, if one of the variants would find it s way into this valuable package and if it helps, I can prepare a pr for Variant 1 and 3. |
This library is really awesome and helpful.
But I want to use customized layout where i could add captions, context menus and much more like that. Is there any way i could use it for that purpose?
Any suggestions would be really appreciated.
Thanks 😊
The text was updated successfully, but these errors were encountered: