Replies: 1 comment
-
I like this idea, I've always been a fan of how Masonry handled their options like that. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Glightbox currently can be configured by specifiying a
data-glightbox="strings_separated_with_semicolons"
. This feature is great, but the data format of a semicolon-separated string can be problematic when dealing with unknown data sourced from a database: What if an editor specified a description containing a semi-colon itself, or a quote (and which quote: single or double?)Suggestion:
Use a stringified JSON object for data-glightbox instead. E.g. SplideJS, Masonry. String interpretations are always error-prone, being able to do JSON.parse / JSON.stringify (or a server-side language like e.g. PHP's json_enode / json_decode) to create the config object solves a ton of edge cases at quite low cost.
As a side effect, this change would allow to define nested structures like e.g. elements to be configured using a declarative data-glightbox syntax.
This proposal is break in backwards compatibility and would require a new major version number.
Beta Was this translation helpful? Give feedback.
All reactions