This is not possible. PhotoSwipe will only display linked images in various formats (including SVG).
If you need such a feature, this needs to be added to the code of PhotoSwipe itself which is out of scope for this plugin.
So can I implement this feature on this plugin by myself?
-
This reply was modified 2 years, 7 months ago by manlok1992.
If you know how to do this – sure. The code is open source and published under the GPL:
https://github.com/arnowelzel/lightbox-photoswipe
Just keep in mind, that any changes need to be published as source code again. So either you create pull request to get your modifications integrated to this plugin when finished or if you publish your own version you need to keep a reference to the original source code of the plugin in the “Info” section and “readme” text.
The frontend scripts (assets/scripts.js) need to be merged in compressed based on the source from src/lib/photoswipe.js, src/lib/photoswipe-ui-default.js and src/js/frontend.js – there is no build script yet to do this automatically.
I tried to revise the photoswipe.js
. I found the setContent
method is used to set image to the html. So I changed something to make it different. I refresh my web and see what different but nothing to be changed. Even I comment all of the code in setContent
is still no changes.
-
This reply was modified 2 years, 7 months ago by manlok1992.
src/lib/photoswipe.js
is not used directly by the plugin. You have to create a new version of assets/scripts.js
which is the combined and minified version of src/lib/photoswipe.js
, src/lib/photoswipe-ui-default.js
and src/js/frontend.js
.
During development you can also enable the WordPress debug mode (SCRIPT_DEBUG
) – in this case the src
folder is used and not the minified script in assets/script.js
.
Also make sure that you clear the cache of the browser before you reload the page.
-
This reply was modified 2 years, 7 months ago by Arno Welzel.