0

I am trying to add social share to my site in order to be able to share some pages information on social media, I used SXA social component, I added share to "twitter, Facebook and Linkedin", however I'm facing a problem in sharing to Facebook and linked-in. I was only able to share the current page url because fb and linkedin APIs takes only the URL as a parameter. But I also need to share more details such as description, title, and image.

For FB API I was following this article And for linkedin i was following this article

Is there a way to share more than the page url to fb and linkedin?

3

So the way that most social sharing works is to share the url and pick up the description & image from the page. You can still control the description and image from the page by setting the Twitter Card and Open Graph fields on your page.

In SXA, these fields are part of the default page templates. To set them, you need to click on the Social button, in the Experience Accelerator ribbon at the top. You can then populate the image and description you want to use for the social platforms.

Entering social media sharing fields

  • thanks alot for your help. i tried your solution however the data i add to the open graph or twitter card never appears in the shared data. Does this have anything to do with my site being local (not published yet)? – AmiraElEwady Mar 7 '19 at 10:43
  • 1
    Yes, this will only work for published sites. The content has to be visible to Twitter or Facebook to use. – Richard Seal Mar 7 '19 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.