Forum

Thread tagged as: Question, Problem

Blog post url

I have a social media share in page template in none blog template and it's working fine. How do i make it work in blog post page template?

 <a class="facebook" href="https://www.facebook.com/sharer/sharer.php?u=https://www.mysite/<?php echo PerchSystem::get_page();?>" target="_blank"><i class="fa fa-facebook-square"></i>Share on Facebook</a>
Edward Johansen

Edward Johansen 0 points

  • 2 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

How is it failing?

On the link url, it's showing the blog page title instead of the actual url link

Drew McLellan

Drew McLellan 2638 points
Perch Support

I think you're going to have to be more specific for anyone to offer any meaningful help.

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Hello Edward,

I wrote an add-on that generates sharing links (inside a template) for you: https://grabapipit.com/pipits/apps/sharing/

Docs: https://grabapipit.com/pipits/apps/sharing/docs

In your case you would use:

<a class="facebook" href="<perch:sharing id="facebook" />" target="_blank">
   <i class="fa fa-facebook-square"></i>Share on Facebook
</a>

Hussein Al Hammad said:

Hello Edward,

I wrote an add-on that generates sharing links (inside a template) for you: https://grabapipit.com/pipits/apps/sharing/

Docs: https://grabapipit.com/pipits/apps/sharing/docs

In your case you would use:

<a class="facebook" href="<perch:sharing id="facebook" />" target="_blank">
  <i class="fa fa-facebook-square"></i>Share on Facebook
</a>

Thanks. I will have a look at this.