0

I would like to use my own image for the LinkedIn share button. I've been following the information on this previous post:

How to make a custom LinkedIn share button

It's noted here that: To create a custom Share button for LinkedIn, you need to make POST calls now.

I've read the Linkedin documentation however I don't understand how to incorporate the POST call with my HTML page. Could someone help explain it to me please?

I've initially tried to use this URL which i understand is now not supported by LinkedIn:

https://www.linkedin.com/shareArticle?mini=true&url=articleUrl&title=YourarticleTitle&summary=YourarticleSummary&source=YourarticleSource

It partially works! The image, title and summary are all incomplete or not what I have specified in the URL, however if I click on the LinkedIn post it does actually link to the right page.

Is there anyway of getting this working?

Many thanks

jd12
  • 3
  • 1
  • 2
  • Without using a `
    ` (which may or may not be amenable to you in your situation), you cannot use the POST method in HTML without also using JavaScript. If you're already familiar with JavaScript, I would recommend taking a look at MDN's [Using Fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch) page. If you're new to JS, on the other hand, I would start by taking a primer course on the language, e.g., MDN's [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) learning area.
    – IronFlare Sep 03 '19 at 19:26
  • Thanks for coming back to me with this information. I'm new to JavaScript so will have a look at the learning area link you provided. You mentioned that I would need to use a
    (i'm amending the html page through a CMS so probably won't be possible but i'd like to explore the idea). I don't quite understand how this can be incorporated into the custom button though? Would the user be required to fill in a form field in order to get this to work? Thanks
    – jd12 Sep 05 '19 at 08:29
  • Ah, I see. Every CMS is different, so assuming you're using a standardized third-party system instead of a custom-built tool, your best bet is to look up the documentation for your CMS. If you *are* using a custom-built tool, you might ask the developers of the tool, assuming you have a support contract with them (I've worked with this kind of situation before, but I'm not sure how typical it is). As for filling in a form field, no-- there is no requirement to fill in a field. You might just create a `
    ` with an input `type=submit`, and possibly store a token in an input `type=hidden`.
    – IronFlare Sep 05 '19 at 13:28
  • ok thanks - really appreciate your thoughts. It is a custom based tool so i'll see if I can ask the developers. Much appreciated. – jd12 Sep 07 '19 at 18:18
  • Hi, jd12, let me know if my answer has been helpful at all, or if there's anything I can improve, thanks! – HoldOffHunger Mar 30 '21 at 21:04

1 Answers1

1

Let's take a quick glance at the Official LinkedIn "Making Your Website Shareable on LinkedIn" Documentation. The URL format should be...

https://www.linkedin.com/sharing/share-offsite/?url={url}

And to have it use the other parameters, such as image, etc., set your og: tags in the HTML of the link you are sharing, like so...

  • <meta property='og:title' content='Title of the article"/>
  • <meta property='og:image' content='//media.example.com/ 1234567.jpg"/>
  • <meta property='og:description' content='Description that will show in the preview"/>
  • <meta property='og:url' content='//www.example.com/URL of the article" />
HoldOffHunger
  • 18,769
  • 10
  • 104
  • 133