Link to Bookmark Anchor, CS 2.1 Makes Incorrect Qualified Fragment

rated by 0 users
This post has 1 Reply | 1 Follower

Not Ranked
Posts 17
Points 235
joedave Posted: Fri, Dec 15 2006 8:30 AM

Hi everyone,

I created a new blog post recently and decided it would be nice to include hyperlinks at the beginning of the post to several headers using anchors (since the post was quite long).  I added anchors like this at interesting locations in my post:

<a name="PostName_Header">Header</a>

Then I added links to those anchors at the beginning of my post as such:

<a href="http://communityserver.org/forums/EditPost.aspx?PostID=560626&ReturnUrl=%2fforums%2fShowThread.aspx%3fPostID%3d560626%23560626#PostName_Header">Header</a>

I then clicked Publish and opened the post in my browser.  Unfortunately, CS qualified each url fragment with the path to the control panel:

<a href="http://domain.name/cs/controlpanel/blogs/posteditor.aspx?someQS=1#PostName_Header" />

Obviously this is unacceptable since when I click any of these links from within my blog it opens up the control panel to edit the post!

As a workaround I hard-coded the path to my post within each link (see P.S. below for a bug I discovered while editing this post):

/cs/blogs/blog/.../somepost.aspx#PostName_Header

The above works but has two flaws:

  1. When a link is clicked on the page that shows all of my blog entries it redirects to the actual post, whereas my original solution (using an unqualified fragment) wouldn't have done that.
  2. I get a pingback from my own blog every time I modify the post and click Publish since I have linked to a blog post from within the blog post itself

I'm hoping that someone will explain how I can fix this behavior in CS so that it leaves my bookmarks alone, prevents a pingback after modifications, or otherwise a better workaround would be acceptable.

Please realize that CS 2.1 is running on a shared server and I don't have access to the database, configuration files or source code.  I can only use the CS control panel.

Thanks for your help.

P.S. Even as I'm trying to author this request for help CS is ruining my post by doing strange stuff with the links above (which aren't even real hyperlinks, they should just be encoded html) such as artifacts of html that was added by CS (things like mce_href="..." appearing out of nowhere).  I've had to do a lot of fiddling just so that the post actually displays as it should, which is crazy since I'm not even editing any of the source html - I'm only entering text directly into the editor.  For instance, in my last example above the Preview window displayed my virtual href qualified to http://www.communityserver.org!  This happens even if the <a /> tag is removed and only href="..." is kept.  The only way I could prevent that, it seems, was to remove both the href attribute and surrounding <a /> tag completely.

 

Not Ranked
Posts 17
Points 235
joedave replied on Fri, Dec 15 2006 8:40 AM

I don't have time to fiddle anymore.  If you take a look at the second anchor example in my post it illustrates exactly the problem I'm having.  The original example looked like this:

<  a      h r e f = "#PostName_Header"   > Header <  /  a >

And CS turns it into:

<a href="http://communityserver.org/forums/EditPost.aspx?PostID=560626&ReturnUrl=%2fforums%2fShowThread.aspx%3fPostID%3d560626%23560626#PostName_Header">Header</a>

The strange thing is that the example isn't really html, it should be encoded, as I mentioned in the P.S. of my original post.

Note: The problem I'm experiencing in my real blog post has to do with real html bookmarks, not just encoded html as in this post.

 

  • | Post Points: 5
Page 1 of 1 (2 items) | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com