- Issue created by @windm
- π©πͺGermany sanduhrs πͺπΊ Heidelberg, Germany, Europe
at 1. Formatter approach
I don't think a pseudo field supports formatters.
You could create a text field or a link field and store the link to the node using a default value and tokens.
For these kind of fields the barcodes formatter will be available.at 2. Global: Custom text
This also does not support field formatters afaict.
You could use the twig filter to render the barcode{{ view_node|barcode('QRCODE', '#000000', 100, 100, 0, 0, 0, 0, 'png') }}
But currently there is a bug in Drupal core's filter system that prevents rendering if inline data images: https://www.drupal.org/project/drupal/issues/3413396 π Xss:filter() malforms inline image references with data uri scheme Needs work
- π©πͺGermany windm
Hi @sanduhrs, thank you for the quick reply.
OK - got that
so "workaround" as per #1 would be:
- introduce a dedicated (text)field to my content-type
- define the node-URL as the "default value" for it (so I do not even have to show it in the form/edit mode?)
- I could hide it or show it in the standard display of the node as I like
- for the "print-view" I could use the field with the formatter "barcode" and make it a qr-code there...#2 with the twig filter looks pretty smart, but does not work, as long as the core bug is not fixed...
to get that right (and maybe move to that solution later), 2 maybe stupid questions:
- te token you have pasted can simply be used as a replacement token in a Global: Custom text field?
- does "twig filter" way require the "twig input filter" module (plus mentioned dependencies) to be installed? Or even more modules? - π©πͺGermany sanduhrs πͺπΊ Heidelberg, Germany, Europe
The "token" is a twig variable and per default available in "Global: Custom text" fields, no further requirements.
- First commit to issue fork.
- Merge request !9Add new Views Field Handler for Barcodes QR Codes, extending EntityLink β (Open) created by brooke_heaton
- Assigned to brooke_heaton
- πΊπΈUnited States brooke_heaton
We can add a Views Field Handler extending EntityLink to handle this and to render the link as a QR code. I have an initial proof of concept for Nodes that is not customizable but is working.
- Status changed to Needs review
5 months ago 8:05am 28 July 2024 - π©πͺGermany windm
Hi @brooke_heaton, sorry for the delayed reply here... and thank you for acting on my support/feature request.
As IΒ΄m not a developer, my stupid question is: "Needs review" means, I could try your Commit 9c441bbc and test it as it is for my case.
What does it need to get it merged into the regular module 2.0.x or 2.1.x ? Guess, there is an official process for this review and approval? Anything to be done from my side?
- πΊπΈUnited States brooke_heaton
@windm - The next step would be to test the patch by applying it via Composer. The patch can be found at teh most recent Pull Request: https://git.drupalcode.org/project/barcodes/-/merge_requests/9.patch
But, with this change we'd also want a maintainer to take a look at the patch and functionality. It likely needs a Test as well.