facebook - Blogger - How to Percent Encode an URL / Escape It to Use as Query Param? -
in blogspot template engine how escape post url use query param can use in facebook / twitter / whatever buttons , iframes?
problem: have iframe src takes url.
<iframe src="https://www.facebook.com/plugins/like.php?href=my_url_goes_here"> so post url http://example.blogspot.com/1999/01/first.html. need convert :/. percent encoded characters, , ?&% etc. otherwise this:
<iframe src="https://www.facebook.com/plugins/like.php?href=http://example.blogspot.com/1999/01/first.html"> and looks it's going break someday. how can escape url in blogger?
the way pretty simple , takes wasting couple of hours searching every corner of internet semblance of documentation on blogspot's template engine , reading through bunch of stackoverflow's answer dismiss question "use shareurl instead."
anyway. every string in blogspot templates has .escaped field string escaped. it. anyurl.escaped , works. can data:post.url.escaped or data:post.url.canonical.escaped or whatever.
<iframe expr:src=""https://www.facebook.com/plugins/like.php?href=" + data:post.url.canonical.escaped + "width=173&layout=button_count&action=like&size=small&show_faces=false&share=true&height=46&appid=your_app_id_here"" width="173" height="46" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowtransparency="true"></iframe> other elusive string attributes can found in extremely fishy blog: http://template-data.blogspot.com.br/2016/04/title_58.html
you'd think google have info somewhere easy find got blogger http api docs? what?
Comments
Post a Comment