Replies: 1 comment 2 replies
-
This leaves an open question around the usefulness of query parameter options long term. If you can save the config for a short URL, does it make sense to continue allowing to customize the QR code via query parameters?
Please react to this message with 👍🏼 or 👎🏼 if you have an opinion. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Shlink has supported generating QR codes for some time, and allows to customize a number of things.
For all the things that can be customized, it allows to set the default value via config options/env vars, but they can be overwritten with arbitrary values at runtime, via query parameters.
So a URL like
https://s.test/abc123/qr-code
would generate a QR code forhttps://s.test/abc123
with the default configuration, andhttps://s.test/abc123/qr-code?size=500&format=svg
would overwrite the size and format params.This has worked well so far, but I have always felt it has some limitations:
Because of this, I have been thinking on supporting a way to persist customized QR code options per domain and per short URL, so that when you visit something like
https://s.test/abc123/qr-code
, Shlink first checks if thehttps://s.test/abc123
short URL has its own QR code config, otherwise falls back to thes.test
domain QR code config, and only if that is not found, it falls back to the defaults set via config options or env vars.Parameters would not be mandatory, and the onse used would be the result of merging short URL-specific, domain-specific, global ones and Shlink defaults, so if a short URL does not define a custom color, but its domain does, that custom color would be used.
Beta Was this translation helpful? Give feedback.
All reactions