Refactor the share buttons template

Created on 8 January 2025, 2 months ago

The issue

The template used for rendering of the share buttons goes against DRY principle, which make it harder to maintain and actually harder to override/customize it. Hard-coded URLs are also a bit of an issue.

Consider following cases...

  • In a hypothetical case where the number of supported social outlets grow you'd have to add more and more repeating code into the template.
  • When a custom button has to be added - you'd have to override and maintain the whole template in your theme
  • In a case where a share URL needs to be changed, and the template is overridden in your theme - besides the module update this will require updating the overridden template as well

Proposed resolution

- create general button template,
- refactor main template to include button template as needed (per what is available in exposed variables)
- move URL formatting into preprocess or specialty callback

✨ Feature request
Status

Active

Version

4.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States euk

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024