Tos Web Developer provides insights, tutorials, and advice around topics including content strategy, design, Drupal Development, Drupal Custom Module Development, Drupal 8 Custom themes, PHP, Server, Twig, and more

Drupal 8SocialShareTwig

WhatsApp share for mobile and Desktop In Drupal 8

WhatsApp share for mobile need to configure 

STEP 1:- Install Share This Module 


STEP 2:- Then go to this URL (admin/config/services/sharethis

change the button size.
Choose a button style: Large Chicklets



pasted+image+0



STEP 3:- After Selected Button style scrolls down and Choose Your Services. selection add Whatsapp icon further information check the below screenshot.)


pasted+image+0+%25281%2529



STEP 3:- after added WhatsApp share in selected service check which content type do you need to show social sharing 


pasted+image+0+%25282%2529



As you check we are selected blog post because we are showing social share to blog Post


STEP 4: All settings are Done Save the configuration.


STEP 5:- Clear Cache and check on the blog post page. (Final Output gives below.)

a552dc9d-f100-4374-b7b1-310224db8aaa



WhatsApp share for Desktop 

STEP 1:- copy file form this stage server :- \modules\contrib\sharethis\templates\sharethis-block.html.twig


STEP 2:- Past the same file on your current set Default Theme Folder given below path


/blog/themes/example_theme/templates/block  


STEP 3:- For Desktop WhatsApp share I have customized ShareThis-block.html.twig file Update the below code.


<div class="sharethis-wrapper">

  {% for span in content.st_spans %}

  {{ span }}

  {% endfor %}

  <span class="wp-desktop"><a href="https://web.whatsapp.com/send?text={{ url('<current>') }}"

      data-action="share/whatsapp/share" target="_blank"><span

        style="text-decoration:none;color:#000000;display:inline-block;cursor:pointer;"

        class="stButton hidden-sm hidden-xs hidden-md"><span class="stLarge"

          style="background-image: url(&quot;https://ws.sharethis.com/images/2017/whatsapp_32.png&quot;);"></span></span></a></span>

</div>


STEP 4:- After added code clear cache.

STEP 5:- Goto The blog post page and check on Bottom.

a552dc9d-f100-4374-b7b1-310224db8aaa



No comments:

Post a Comment

| Designed And Blog Post by www.toswebdeveloper.com