HOW-TOs

How to put HTML from a outside sources into your blog


Option 1: Putting third party code in a gadget


  • Copy the code from the third-party site.
  • In Blogger, choose Layout > Add a Gadget > HTML-Javascript Note:  Use the gadget created by Blogger which is in the Basic list.  Currently you need to see to scroll down the list of gadget to see it. 
    Don't use the search tool to find it, because currently (2/11/10), it returns a 3rd party gadget that doesn't work.)
  • Paste the code into the Contents field.
  • Enter a title, if you want the gadget to have one
  • Press Save.  
  • Drag-and-drop the new gadget to where you want it to appear.
  • Save the layout

Option Two: Put third-party code inside a post

  • Copy the code from the third party site
  • Go to blogger and Edit the Post (or Page) that you want to put it on
  • Switch into HTML mode
  • Paste the code in at the place where you want the item to go.
    If you are not familiar with HTML, it may help to put in some marker text at the place where you want the product link while you're still in Compose mode.  Then switch to Edit HTML mode, find it and replace it with the third-part code.
  • Switch back to Compose mode
    This sometimes lets you see the 3rd party item within the post editor - although sometimes it just shows as a blank box, or even just as a blank line (I sometimes surround lines like this with some marker text, eg xxx, while I'm editing the post, to make sure I don't accidentally over-type of the code.
    If you forget to go back to Compose mode before you press Publish, you may get confused the next time you edit a post.


Option Three: Put the third-party code into your template


You should only use this option if you are very familiar with how your template works, and you accept the disadvantages of editing it.

Also, be aware that for some third-parties, putting the code into your template can over-ride controls that usually come with it (eg for AdSense, only displaying up to three ad-units and three link-units per screen).  For other types of code, the tweaks that are needed to make it work within Blogger may break the other parties terms-and-conditions (eg if they say you cannot change the code at all).   You need to weigh up the risks and issues involved for each individual third party.
  • Edit your template in the usual way
  • Work out where exactly the code needs to go, and put it there.
  • Preview the change, to make sure it works
  • Save the template

No comments:

Post a Comment