Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to embed 3rd party widgets on Blogger

As a webmaster, how can I allow Blogger users to embed my content on their blogs?

I tried the following solution - simple button redirecting to:

https://www.blogger.com/blog-this.g?u=[ MY URL ]&t=[ MY WIDGET CODE ]

with tag inside [ MY WIDGET CODE ].

I encountered two problems:

  • the <script> tag seems to be erased automatically from proposed post content

  • even if user copies and pastes the script, it only works after publication - so user is unable to see how is it going to look like in the preview

Thanks in advance for any tips :)

Note: I know it is probably a security issue, but if blogger is able to post content with scripts then why isn't he able to preview them?

like image 723
dev9 Avatar asked Sep 13 '14 08:09

dev9


People also ask

How do I add a widget to Blogger?

Adding widgetsLog in to your Blogger account. Choose where you'd like to place your widget and click Add a Gadget. Scroll down to "HTML/JavaScript" and click the + icon to the right. Copy your widget code from the Branded Web Manager and paste it into the HTML/JavaScript box along with a title.

How do I embed a widget code in HTML?

Step 1 – Choose HTML as website platform and set the width and height of the widget as per your requirement. Step 2 – Now, Copy the generated embed code displaying on the screen. Step 3 – Then open the backend of your HTML website and Paste the embed code into the webpage where you want to embed the widget.


1 Answers

If your problem is that script tags are erased then you can make a js file and host it on google drive or any other servers you like and link this js to your blog template. I used this approach for third party plugins like codehighlighter and it works. You can see http://a2znotes.blogspot.com

like image 191
RN Kushwaha Avatar answered Oct 07 '22 16:10

RN Kushwaha