Print Page | Close Window

Facebook & LinkedIn share

Printed From: openElement Website
Category:

openElement


Forum Name: openElement General Discussion
Forum Description: A place for general discussion and questions about the software.
URL: https://forums.openelement.uk/en/forum_posts.asp?TID=1689
Printed Date: Mar 28 2024 at 6:40pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Facebook & LinkedIn share
Posted By: WattJet
Subject: Facebook & LinkedIn share
Date Posted: Jun 22 2020 at 7:12pm
Hi,  I want to periodically share entries/posts etc with Social Media (Facebook, LinkedIn etc)
My website has short entries/posts that I would be interested in making shareable through a share button.

I read the entries on Facebook of this forum (July 2018), refer ways by which the button will lead to the facebook site, but I would be interested that the link leads to the user's feed in facebook ( or Linkedin).

In the sensode black template, I  tried to use a share button HTML to two articles of my site.
The URLs of the articles in my site are:

https://-------------------.com/actualites.htm#news1
https://-------------------.com/actualites.htm#news2


FACEBOOK
I used this html code added to the link of the button element

https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2F------------------.com%2Factualites.htm%23news1

https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2F----------------.com%2Factualites.htm%23news2

This one seems to work well for both links



LINKEDIN
 I first used this html code added to the link of the button element
"https://www.linkedin.com/shareArticle?mini=true&url=https://-------------.com/actualites.htm#newsXX&title=&summary=--------------? &source="

I do not get an error message, but LinkedIn does not seem to accept it (I get the "ooops, it's us, try again later", but it happened for two days now, so I imagine it does not really work)


Then, I tried with this other
http://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2F--------------.com%2Factualites.htm%23news1&title=%20xxxxxx%20xxxxxx%20xxxxxxx%3F

http://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2F----------------------.com%2Factualites.htm%23news2&title=yyyy%20yyyyyy%20yyyyyy%20yyyyyy%3F

And LinkedIn tries always to publish #1 instead of #2.
I have cleared the cache of my PC several times, I have verified that there is no mistake in the links...the first news has a link#1, the second has a link to #2, both have different titles, but it clicking on #2 makes LinkedIn go to #1



As an alternative, according to LinkedIn, the script to use is
"<script src="https://platform.linkedin.com/in.js" type="text/javascript">lang: en_US</script>
<script type="IN/Share" data-url="https://www.linkedin.com"></script>"

How do I add this to a LinkedIn button? ... and would there be a similar procedure for a facebook button?

Any guidance in any of the above will be welcome



Replies:
Posted By: Hobby001
Date Posted: Jun 22 2020 at 8:39pm
You are following instructions from this page:  https://docs.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/plugins/share-plugin" rel="nofollow - https://docs.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/plugins/share-plugin

Put their instructions into a Code Block Visual that you install at your preferred location:

See temporary example :  https://denislafrance.net/TestPage.htm" rel="nofollow - https://denislafrance.net/TestPage.htm

Just make sure to change the data-url for your own 


-------------
https://denislafrance.net/index.en.php" rel="nofollow - https://denislafrance.net https://www.youtube.com/playlist?list=PLWg7A6YtIr7WE2oJe9pX8_3u0FerqJwjo" rel="nofollow - , OE training video


Posted By: Hobby001
Date Posted: Jun 22 2020 at 9:02pm
Fr FB use  https://developers.facebook.com/docs/plugins/share-button/?locale=en_us#" rel="nofollow - https://developers.facebook.com/docs/plugins/share-button/?locale=en_us#  instructions

Put the Javascript SDK into an HTML code block in Start Body position once for the page

Put the second piece of code in a visual code block


-------------
https://denislafrance.net/index.en.php" rel="nofollow - https://denislafrance.net https://www.youtube.com/playlist?list=PLWg7A6YtIr7WE2oJe9pX8_3u0FerqJwjo" rel="nofollow - , OE training video


Posted By: WattJet
Date Posted: Jun 22 2020 at 9:38pm
Hi Hobby001

Thanks again for all your help

For the LinkedIn,  I followed your instructions, and it does include the visual code in the page, but I cannot match it with the image for LinkedIn that I have ( I do not know how to do it) I searched the doc for the block, and it shows  what  I see, but not how to match it with an image element.

The example of the french page that you include only applies to facebook and it is applied to a text, not to an image

Regarding Facebook, I modified the script and it works (I was editing my original message when you answered me), so for the time being it is solved. I will see to do it after completing the LinkedIn one -that seems more simple since there is only one code block to do -.


Posted By: Hobby001
Date Posted: Jun 23 2020 at 2:03am
I have no clue on how LinkedIn operates

-------------
https://denislafrance.net/index.en.php" rel="nofollow - https://denislafrance.net https://www.youtube.com/playlist?list=PLWg7A6YtIr7WE2oJe9pX8_3u0FerqJwjo" rel="nofollow - , OE training video


Posted By: WattJet
Date Posted: Jun 23 2020 at 2:54pm
Thanks for getting back.

Let me rephrase the question:

I have the Code Block Visual with the script that I installed at a specific location in the page.

I want to use an image to click on to activate that Code Block Visual.

The question is how do I make the script run by clicking on an image (in the same way that the element image can have a link that is activated when click over.




Posted By: Hobby001
Date Posted: Jun 23 2020 at 5:31pm
The text block comes from LinkedIn directly you should ask them if there is any possibility

-------------
https://denislafrance.net/index.en.php" rel="nofollow - https://denislafrance.net https://www.youtube.com/playlist?list=PLWg7A6YtIr7WE2oJe9pX8_3u0FerqJwjo" rel="nofollow - , OE training video


Posted By: Hobby001
Date Posted: Jun 23 2020 at 6:08pm
You can try this:  

Select your preferred image and add it to your project trough the Ressources pannel and use it to publish the image on your host.

Then modify the following code accordingly

<a href="https://www.linkedin.com/sharing/share-offsite/?url=https://www.denislafrance.net/TestPage.htm"target="_blank" title="Share on LinkedIn">
<img src="Files/Image/LinkedIn.jpg" width="30" height="30">
</a>

And replace the code Block (visual) content with it

See example here:  https://denislafrance.net/TestPage.htm" rel="nofollow - https://denislafrance.net/TestPage.htm



-------------
https://denislafrance.net/index.en.php" rel="nofollow - https://denislafrance.net https://www.youtube.com/playlist?list=PLWg7A6YtIr7WE2oJe9pX8_3u0FerqJwjo" rel="nofollow - , OE training video


Posted By: WattJet
Date Posted: Jun 23 2020 at 7:59pm
Thank you so much for this Hobby1!


Posted By: WattJet
Date Posted: Jun 23 2020 at 11:06pm
Hi again,

I saw I tried the link in denislafrance.net page. and it works well
When I pass the mouse over the link, I can see that it is pointing to https://www.linkedin.com/sharing/share-offsite/?url=https://www.denislafrance.net/TestPage.htm and that the sharing with LinkedIn works

However, when I introduce mine it does not work.

When I add to the link element  the URL, it loses the "//" and then it does not work

So, this is what I add:
https://www.linkedin.com/sharing/share-offsite/?url=https://www.-------------.com/actualites.htm

...and this is what appears:
https://www.linkedin.com/sharing/share-offsite/?url=https:www.----------------.com/actualites.htm

and as a result, the link  and share does not work





Posted By: Hobby001
Date Posted: Jun 24 2020 at 3:20am
I need a link to your site to help you



-------------
https://denislafrance.net/index.en.php" rel="nofollow - https://denislafrance.net https://www.youtube.com/playlist?list=PLWg7A6YtIr7WE2oJe9pX8_3u0FerqJwjo" rel="nofollow - , OE training video


Posted By: WattJet
Date Posted: Jun 24 2020 at 11:21am
So, I tried this other approach introducing as link

www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fxxxxxxxxxxxxx.com%2Factualites.htm%232&title=xx+xxt+xxxxx.htm&source=xxxxxxx.com" rel="noopener"

For once, it took me to the LinkedIn site, but it shares the article at the top of the page (https://xxxxxxxxxxxxx.com/actualites.htm#news1), instead of sharing the article that I am pointing to  (https://xxxxxxxxxxxxx.com/actualites.htm#news 2)

Here is the image: https://snipboard.io/jwgIQs.jpg" rel="nofollow - https://snipboard.io/jwgIQs.jpg


Posted By: Hobby001
Date Posted: Jun 24 2020 at 11:59am
I can't help anymore without a link to your hosted site.

-------------
https://denislafrance.net/index.en.php" rel="nofollow - https://denislafrance.net https://www.youtube.com/playlist?list=PLWg7A6YtIr7WE2oJe9pX8_3u0FerqJwjo" rel="nofollow - , OE training video


Posted By: WattJet
Date Posted: Jun 24 2020 at 9:58pm
Thanks again for coming back Hobby001

The site is https://--------------------------.com/

Link I am working with is  the LinkedIn share at https://-----------------.com/actualites.htm#news2

As you can see, the link
www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2F----------------------.com%2Factualites.htm%232&title=Is+it+possible.htm&source=----------------------.com" rel="noopener"

But then, it shares this  Link https://------------------.com/actualites.htm



Posted By: Hobby001
Date Posted: Jun 25 2020 at 12:16am
edit the code block visual and replace the link generates by linkedin 



with the following

<a href="https://www.linkedin.com/sharing/share-offsite/?url=https://mydatamygain.com/actualites.htm#news2"target="_blank" title="Share on LinkedIn">
<img src="Files/Image/Linkedin.jpg" width="30" height="30">
</a>


-------------
https://denislafrance.net/index.en.php" rel="nofollow - https://denislafrance.net https://www.youtube.com/playlist?list=PLWg7A6YtIr7WE2oJe9pX8_3u0FerqJwjo" rel="nofollow - , OE training video


Posted By: WattJet
Date Posted: Jun 25 2020 at 2:18am
Thanks again Hobby1 for taking the time

I did as instructed, but also left the preexisting image with the link described above.
Whether you click:
  • on the code block visual or
  • in the (old) Linkedin Image www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2F--------------.com%2Factualites.htm%232&title=xx+xx+xxxxxxx.htm&source=---------------.com" rel="noopener"
In both cases what is shared with Linkedin is https://------------------.com/actualites.htm
completely disregarding the final part of the url https://-----------------.com/actualites.htm#news2

Hence, the post shared in LinkedIn is the one at the top of the page.
As you have read in the template entry, I managed to revert the order of entries, so now News03 is at the top of the page. I have tested the link and it gets you there.

Finally,  I made another test posting News 02 directly in Linkedin site   -manually entering https://--------------------.com/actualites.htm#news2 in LinkedIn. Unfortunately the effect is the same... the  link disregards the last part of the URL and keeps only until ".htm"

But, what makes it worse is that link is associated in their files with a previous entry so what appears as a snippet in LinkedIn page is the News01 that I posted on Friday (See below), but when clicked, it leads to  https://------------------.com/actualites top of the page, which is now News03

So, now the question changes completely. Is there any other way to define the areas of the actualites page in the template that allows to have a different URL configuration (for instance https://------------------.com/actualites/news2.htm?

-----------
To clarify: I copied News02, the snippet saved by LinkedIn corresponds to News01 but when clicked the link gets you to the top of the page (News 03)
https://mydatamygain.com/actualites.htm" rel="nofollow -
- - - -


Posted By: Hobby001
Date Posted: Jun 25 2020 at 9:52am
I have only one answer left: You should ask LinkedIn why they don't consider the anchor in the URL.

-------------
https://denislafrance.net/index.en.php" rel="nofollow - https://denislafrance.net https://www.youtube.com/playlist?list=PLWg7A6YtIr7WE2oJe9pX8_3u0FerqJwjo" rel="nofollow - , OE training video



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net