I am trying to implement facebook share button in my webpage. Here is my code:
<a class="btn btn-social-icon btn-facebook" href="https://www.facebook.com/sharer/sharer.php?u=test.com" target="_blank">
<i class="fa fa-facebook"></i>
</a>
What are my options if I want to share just a simple text, not an URL ? Is there some kind of text param ?
Facebook allows meta tags to specify some parameters to pass over.
See facebooks developer page for more info.
Related
I am working on odoo12 and trying to attach document/image with whatsApp. Now i'm only able to share message(url link) with whatsapp and try to upload image also.
my code is below:
<a t-att-href="'%s?text=%s' % ('https://api.whatsapp.com/send', survey.public_url)"
target="_blank"
class="">
<i class="fa fa-2x fa-whatsapp"/>
</a>
Thanks in advance.
I want to display LinkedIn popup in a small new window, but the share popup keeps opening as a new full screen tab.
This is the piece of HTML I'm using:
<div class="share-block">
<a
href="#"
onclick="window.open('http://www.linkedin.com/shareArticle?mini=true&url=' + encodeURIComponent(document.URL) + '&title=Excellent review on my website reviews', '_blank, width=500, height=500, resizable=yes, scrollbars=yes'); return false;"
><i class="fa fa-fw fa-linkedin"></i> LinkedIn</a>
</div>
I'm using the same code for Facebook and Twitter which opens up the popup in a new small window as it should. This is the Twitter HTML for example:
<div class="share-block">
<a
href="#"
onclick="window.open('https://twitter.com/intent/tweet?text=Excellent review on my website:%20' + encodeURIComponent(document.URL), '', '_blank, width=500, height=500, resizable=yes, scrollbars=yes'); return false;"
><i class="fa fa-fw fa-twitter"></i> Twitter</a>
</div>
I can't figure out why doesn't it work with LinkedIn. This is what I want to achieve
How to display LinkedIn share in new window like shown on the image?
The second argument in the window.open is for title. You missed that in your linked in popup. So that it treat as all the _blank, width=500..... everything as title. That is the reason it is not following any property width and height and etc. Add that empty string as the second parameter ''.
Fiddle DEMO
The options for the window.open are in the third parameter instead of in the second, where they should be.
I have a working whatsapp <a> tag in this way:
<a class="whatsapp share-local-button
data-action="share/whatsapp/share"
target="_blank" href="whatsapp://send?text=link#withMark" >
<i class="fa fa-whatsapp"></i>
</a>
This works, but what is in href is simply the shared text, not the url, which is the current....
I tried with
data-href="link#withMark"
But no different results...
How can I share my customized url and not the current one?
Try adding something like a bit of PHP if you are able to. if you want to keep it clean html then just ignore this.
in php u define the link u want to set in a variable, then just add <?php $yourvariable ?> to the whatsapp://send?text= INSERT HERE
Add a JavaScript code as I did to dynamically add the link.
Also it is reusable and can be used in any page.
Here, we set the href of the element having class=whatsapp to it's href+ the site link.
Try running the code
document.getElementsByClassName('whatsapp')[0].href+=window.self.location;
<a class="whatsapp share-local-button
data-action="share/whatsapp/share"
target="_blank" href="whatsapp://send?text=">
<i class="fa fa-whatsapp">whatsapp</i>
</a>
I wanted to add social profile links schema for SEO,
Now according to https://developers.google.com/structured-data/customize/social-profiles
<a itemprop="sameAs" href="http://www.facebook.com/your-company">FB</a>
It should work, but what if in my code it has to be:
<a itemprop="sameAs" href="https://twitter.com/your-company">
<i class="fa fa-twitter"></i>
</a>
Would this be understood by Search Engines correctly as a twitter link or would they just understand it as a social media link without being able to figure out that the href points to twitter? I'm pretty sure it works, but I'd like to be more sure.
Do anyone know how to make a facebook share button with 2 actions ? similar like this , I got a html page with an IQ question ,when you click to share and link to answer pages .
Here are the question page look like :
Here is the code of share button:
<a class="btn-u btn-u-lg btn-block btn-u-dark-blue" href="###" target="_blank">
<i class="fa fa-facebook"></i> Facebook
</a>
Thanks for help