samedi 26 janvier 2013

Links and anchors in Blogger

  Blogger has the bad habit to alter the links to anchors and anchors themselves when we enter the Compose mode (Wysiwyg). Here two examples:

anchor:

<a name="myanchor"> </ a> becomes <a href="" name="myanchor"> or worse: <a href = "http://www.blogger.com/blogger.g? blogid = 8531780536436554191 "name =" myanchor "> </ a>.

Link to anchor:

<a href="#myanchor" target="_self"> My anchor </ a> unfortunately becomes <a href = "http://www.blogger.com/blogger.g?blogID = 853178053643xxxxx#myanchor "target =" _self "> My anchor </ a>

And it does not work any more!

Here is my solution:
  • Go to this french website: http://jean-louis.pierre.pagesperso-orange.fr/Crypter-le-HTML.htm. This site allows you to encode a piece of HTML code in Java Script. We can even encode a whole page or a message ... The same utility can also decode a previously encoded HTML.
  • Paste the link to the anchor (in HTML) in the form and click "Encoder"
  • Copy the obtained code and paste it in place of your original link (HTML mode).
  • Do the same with the anchor. Paste the obtained code to the desired location in your blog (in HTML mode).
Et voilà !


Try it in an iframe displaying one of my minimalist blogs. Click on the link and you will go instantaneously to the anchor:




Note: Lien inaltérable = Unalterable link, Texte du lien = Link text, Emplacement de l'ancre = Anchor location


Note that when a message containing an anchor goes in "older posts", the link to this anchor will no longer work.
In my opinion, the use of anchors should be reserved for blogs designed as websites except for quick links as "Go to the top".
Here is one of my blogs with many anchors (it's not a real blog): La Maison de Léon or here: St Martin Meteo Weather.

Sorry for my poor English!

Aucun commentaire:

Enregistrer un commentaire