Problem/Motivation
First of all, apologies for posting this here, which is probably not the right place to post questions. I spent an ungodly amount of hours trying to change the icons via tokens but nothing seems to work (I can change them via css or html, but I need to change them via tokens in this case).
So, I got a button set and need to replace the icons. If I understand correctly (I probably don't) tokens get the image either from a node field ([node:field_image:url] default value, or the default directory of the site's logo [rrssbsite:logo-url]. I don't know what I am doing wrong, but I can't seem to get my custom SVGs (or PNGs) that way. I would really appreciate a few pointers or a couple of image token examples.
Also, is it possible to get an SVG/PNG from a custom directory within the project through these tokens?
PS: I am on Drupal 9.0.6.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | rrssb.hook_rrssb_buttons.3177996-4.patch | 2.85 KB | adamps |
| #4 | rrssb.hook_rrssb_buttons.3177996-4.patch | 2.85 KB | adamps |
Comments
Comment #2
drupaluser42 commentedComment #3
adamps commentedThe purpose of the tokens is to work out what image to use for a node when share_url/follow_url contains [rrssb:image]. This is only used for pinterest in the default config. So it's not what you want, I think.
For the icons, the module does not support PNG - it must be SVG. These are generated in code from
hook_rrssb_buttons()in the following priority order:- Config 'svg' = Inline definition as an
- Config 'svgfile' = Path to an SVG file
- Look for matching name icon in the RRSSB library icons directory
The current comment on the hook is wrong so it would be useful to fix it.tag .
Comment #4
adamps commentedComment #6
adamps commentedComment #7
adamps commentedPatch failed to apply in #4 because I had already committed it too soon.