Problem/Motivation

Whatsapp is enabled in /admin/config/services/better_social_sharing_buttons/config but icon not showing

Steps to reproduce

Click on "Enable Better Social Sharing Buttons display field for nodes" checkbox and save. The .social-sharing-buttons div appears but there is no Whatsapp icon, neither any html related with it.

Same occurs with a placed block.

Thanks

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

  • 3573554- Comparechanges, plain diff MR !46
  • 5.x Comparecompare

Comments

edgar saumell created an issue. See original summary.

edgar saumell’s picture

It seems that removing the conditional in the template solve this.

modules/contrib/better_social_sharing_buttons/templates/partials/whatsapp.html.twig

{# WhatsApp share button #}
{% if items.services.whatsapp %}
  <a href="https://wa.me/?text={{ items.page_url }}"
     target="_blank"
     title="{{ 'Share to @service'|t({'@service': 'WhatsApp'}) }}"
     aria-label="{{ 'Share to @service (opens in a new window)'|t({'@service': 'WhatsApp'}) }}"
     class="social-sharing-buttons-button share-whatsapp"
     rel="noopener">
    <svg aria-hidden="true" width="{{ items.width }}" height="{{ items.width }}" style="border-radius:{{ items.radius }};">
      <use href="{{ social_buttons_sprite }}#whatsapp" />
    </svg>
    <span class="social-sharing-buttons-visually-hidden">
      {{ 'Opens in a new window'|t }}
    </span>
  </a>
{% endif %}

Should be:

{# WhatsApp share button #}
  <a href="https://wa.me/?text={{ items.page_url }}"
     target="_blank"
     title="{{ 'Share to @service'|t({'@service': 'WhatsApp'}) }}"
     aria-label="{{ 'Share to @service (opens in a new window)'|t({'@service': 'WhatsApp'}) }}"
     class="social-sharing-buttons-button share-whatsapp"
     rel="noopener">
    <svg aria-hidden="true" width="{{ items.width }}" height="{{ items.width }}" style="border-radius:{{ items.radius }};">
      <use href="{{ social_buttons_sprite }}#whatsapp" />
    </svg>
    <span class="social-sharing-buttons-visually-hidden">
      {{ 'Opens in a new window'|t }}
    </span>
  </a>

shivamsen_12579 made their first commit to this issue’s fork.

shivamsen_12579’s picture

Status: Active » Needs review
divya.sejekan’s picture

StatusFileSize
new21.37 KB

Verified the MR!46
Now the watsapp icon is visible after enabling
RTBC++

shelane made their first commit to this issue’s fork.

shelane’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.