- Issue created by @euk
- First commit to issue fork.
- πΊπΈUnited States shelane
I have a refactoring of the templates, but it's not by what you suggest. I'm not sure what you are calling for exactly. So, if there is something you would like to see, please submit an MR.
-
shelane β
committed a8d9e759 on 4.x
Issue #3498245 by shelane: Refactor the share buttons template
-
shelane β
committed a8d9e759 on 4.x
- πΊπΈUnited States euk
Hi there! Thanks for looking into this. What you have in the MR36 is not exactly what I was calling for, but very close. You simple split the main template file into individual button files, but still have the same repeating code across them (probably all of them, I didn't check them all).
You could simplify things down even more by having a single template file, and then just bring out all variable pieces out into some preprocess callback. Then here, at https://git.drupalcode.org/project/better_social_sharing_buttons/-/merge... you would just need to pass all the variable peaces into the include statement.
As far as using twig include - you could also use a button theme hook, which would be called automatically when you print a list of buttons.
This would make things really extensible.But let me try and see what I can get you in another MR.
- πΊπΈUnited States shelane
I understand your point, but they don't all have the same pattern. The structure of email and print, for instance, is different. Also, some attach libraries in the template.
- πΊπΈUnited States euk
Those are just two exceptions. Template suggestions can address differences, and libraries can be attached on as needed basis in preprocess callback. I have pretty much working solution, just need to buff a few things.