How to add attachment of document with whatsapp sharing odoo 12 - html

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.

Related

Why I can not see the icon pics in Angular mat-icon-button?

I found this part of code in an Angular project and I wanted to add it to my program too:
<div style="text-align:center">
<a mat-icon-button class="btn-google-plus" href="http://google.com/+"><i class="fa fa-google-plus fa-lg"></i></a>
<a mat-icon-button class="btn-facebook" href="http://www.facebook.com/profile.php?id="><i class="fa fa-facebook fa-lg"></i></a>
<a mat-icon-button class="btn-linkedin" href="http://www.linkedin.com/in/"><i class="fa fa-linkedin fa-lg"></i></a>
<a mat-icon-button class="btn-twitter" href="http://twitter.com/"><i class="fa fa-twitter fa-lg"></i></a>
<a mat-icon-button class="btn-youtube" href="http://youtube.com/"><i class="fa fa-youtube fa-lg"></i></a>
<a mat-icon-button class="btn-mail" href="mailto:"><i class="fa fa-envelope-o fa-lg"></i></a>
</div>
But the problem is that I can not see the pictures(symbols) of each icon inside of it and it shows icons with no pics in my app! What is the problem and how can I fix it?
You are used a Font Awesome Icon in your code so you need to add the library in your angular setup. Please refer to this link on how you can use the Font Awesome library in your setup.
Or else you can just call the external stylesheet in your index.html then it will work fine also. Please refer to the external stylesheet URL.
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" />
Hope this helps!
Thank you.
This part of your code <i class="fa fa-linkedin fa-lg"></I> inform that you want to show icons from Awesome Font
If you want to do that you should add import this font in your app e.g in: index.html.
<link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css">
More info on how to use this font you will find here
Doing the Angular course on Coursera in 2022, I faced this same problem. The code in the question is identical to the code in the course, so I assume OP faced it in that course as well.
Here is a solution that is specific to this question in the context of the conFusion web site developed for this course:
In src/_variables.scss, I was able to fix this problem by setting
$fa-font-path : '../fonts';
instead of ../node_modules/font-awesome/fonts as instructed.
It appears that when you have this import in styles.scss in an Angular project:
#import '../node_modules/font-awesome/scss/font-awesome.scss';
the $fa-font-path variable is interpreted as being relative to where the Font Awesome scss files are all located, which is where that variable is actually used, rather than relative to where your styles.scss file itself is located.
I am doing the course with Angular 14.2. I assume the instructor's instructions worked as is where he recorded the course in 2018 or so, but things have changes with SCSS since then.

Download file from local path / server path using html tag <a> (newbie)

I am trying to download a file on image click using following code -
<a href="file:///D:\dir\a.pdf" target="_self" download>
<i class="glyphicon glyphicon-download-alt" id="download"> </i>
</a>
If I add any html url, it's working fine but here it dosen't do anything. Please help
[EDIT]
I have even tried -
<a href="file:///D:/dir/a.pdf" target="_self" download>
<i class="glyphicon glyphicon-download-alt" id="download"> </i>
</a>
Using file:///... will only work if your HTML page is also local (opened via file:/// also). If that is not the case look at: http://www.websina.com/bugzero/kb/browser-file-url.html

whatsapp button sharing different url than actual

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>

Facebook sharer.php - share text?

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.

Linking another HTML page ,when clicked a facebook share button

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