Monday, July 05, 2010

Anchor Links, And Post Editor Compose Mode

Long ago, before my previous blog improvement, I would include a link to the top of the displayed page, at the end of my posts.

Before I added my "Top Of Page" button, I would compose my posts in "Edit HTML" mode, and at the end of each post, I would add

>> Top
<a href="#Top">&gt;&gt; Top</a>

That gave me a link to the top of the page, since I included an anchor link "Top" inside an HTML gadget, at the top of the page.

<a name="Top"></a>

That's simple enough, once you get used to adding the code.

There's a caveat here, though.

Having added the code
<a href="#Top">&gt;&gt; Top</a>
I have learned, the hard way that I cannot ever edit the post using Compose mode. Any time that I edit the post using Compose mode,
<a href="#Top">&gt;&gt; Top</a>
becomes
<a href="http://www.blogger.com/post-create.g?blogID=24069595#Top">&gt;&gt; Top</a>

The only solution was, that any time I created a post, I would add
<a href="#Top">&gt;&gt; Top</a>
last. Then, stay in "Edit HTML" for any more editing.

Blogger Engineering has been shown this problem a few times. It's possible that it is deeply embedded in the Blogger code base, and will require much work to be diagnosed.

In my case, I eliminated the need to add anchor links, by adding my "Top Of Page" button. That eliminates 99% of the anchor links, that I add to my posts.

This may be a problem which we have to know about, and avoid causing. Compose and install anchor links, after you finish using Compose mode.

Dude, hit me with a comment!

Chris S. said...

I've noticed that too, but I didn't realize it could be avoided by staying in HTML mode. Thanks for the tip!

Enchanted Gardens said...

This was driving me crazy! I found a more permanent solution - http://www.blogging.robertosblogs.net/2009/07/anchor-links-within-post.html

Glad to know I'm not alone!

RoryBore said...

oh may the shine upon you all the days of your life!!! I have been trying for hours to get my anchor tags to work -- they would work in preview, I'd switch to "Compose" then publish....the published page wouldn't work.
This is the first tutorial - and I've looked at dozens!! -- that provided that handy little tip.
THANK YOU!!

Melanie Friedrichs said...

Thanks! ugh that was annoying!