Home Search Member List Faq Register Login  
UltimateEditor
Anchor to same page

Thread Starter: gthomson   Started: 08-23-2006 2:03 AM   Replies: 14
 Karamasoft Support Forums » General Discussions » UltimateEditor » Anchor to same page
 Printable Version    « Previous Thread   Next Thread »
  23 Aug 2006, 2:03 AM
gthomson is not online. Last active: 1/29/2007 12:10:34 PM gthomson

Top 10 Posts
Joined on 08-23-2006
Posts 13
Anchor to same page
I have a person copy/pasting HTML into the editor while in HTML mode.
The HTML has anchors to the same page which copy/paste in okay.
When the page is saved, the anchors are extended to include the whole URL from the page the UltimateEditor is embedded in (a login-protected page).
When the info is pulled back out of the database and displayed on the page available to the public, it's linking back to the login protected page.

Is there a config setting somewhere that will tell UltimateEditor not to expand anchors to include the whole URL from the original page when saving?

Greg

  
  23 Aug 2006, 1:30 PM
Karamasoft is not online. Last active: 9/2/2010 12:02:18 PM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 5,325
Re: Anchor to same page
How do you save the page (using the save button and saving it on the client-side or saving EditorHtml property in the database)? How does EditorHtml look like before saving the page? If you let us know what link you are trying to save and what it is converted to the next time you open the page, we can help you better.
  
  25 Aug 2006, 12:23 AM
gthomson is not online. Last active: 1/29/2007 12:10:34 PM gthomson

Top 10 Posts
Joined on 08-23-2006
Posts 13
Re: Anchor to same page
The EditorHtml property is used to save the info via button click to stay consistent with the other pages in the app.

It seems the inpage anchor is actually getting converted to the full URL by just switching from HTML mode to Design mode, and back, and before the EditorHtml info is saved to the server.

The following copied into HTML view:
<a href="#test">This is a test of an in-page anchor</a>
<br>
<br>
<a name="test">
This is the named anchor
<br>
<br>
End of page

Ends up as the following when switching from HTML view, to Design view, and back:
<A href="http://edweb2.pylusd.org/echo/portal/staff/dcpadd.aspx?un=&amp;site=#test">This is a test of an in-page anchor</A> <BR><BR><A name=test>This is the named anchor <BR><BR>End of page</A>

The site is still in development/test mode, so if you'd like to login as me and take a look, you're welcome to.
Username: gthomson
Password: welcome
Login page: http://edweb2.pylusd.org
Click on 'Add new' under the Dynamic Pages section, and it'll get you to where the editor is embedded.

Greg

  
  25 Aug 2006, 2:25 PM
Karamasoft is not online. Last active: 9/2/2010 12:02:18 PM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 5,325
Re: Anchor to same page
You are right, the problem happens when you switch between Design and HTML modes. It seems that when innerText property is converted to innerHTML in Internet Explorer, it adds the whole path of the URL to the beginning of the anchor. We tried the same thing in Firefox and the problem doesn't happen. It must be a bug in Internet Explorer. As a workaorund, before you save EditorHtml property to the database, you can remove the path from a href by replacing the path of the current page with empty string. You can find the whole path of the URL using ServerVariables SCRIPT_NAME.
  
  15 Jan 2008, 11:35 AM
GCB is not online. Last active: 4/23/2009 1:45:57 PM GCB

Top 10 Posts
Joined on 12-10-2007
Posts 78
Re: Anchor to same page
This bug not only changes anchor links, but any relative link such as href= or src= which does not have "http://".  I wish I could show you all the code I have had to write and time I have had to spend to get around this "bug."

I'm using UltimateEditor as the editor in a content management system I'm developing.  This idea is to allow non-technical people to edit web page content which may and usually does contain html.  I've subclassed UltimateEditor with overall good results.  But this bug is a pain. 

Blaming this problem on IE and putting it off on users to code around it is not satisfactory.  If you put your heads to it there ought to be something you can do to fix this. 

You guys do good work and I know you can come up with a solution.  Thanks.

  
  15 Jan 2008, 4:04 PM
Karamasoft is not online. Last active: 9/2/2010 12:02:18 PM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 5,325
Re: Anchor to same page
We will add this issue to our future enhancement list. Thanks for your feedback.
  
  15 Jan 2008, 7:39 PM
GCB is not online. Last active: 4/23/2009 1:45:57 PM GCB

Top 10 Posts
Joined on 12-10-2007
Posts 78
Re: Anchor to same page
Let me know when you have a fix.  Thanks.
  
  24 Jan 2008, 12:12 PM
Karamasoft is not online. Last active: 9/2/2010 12:02:18 PM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 5,325
Re: Anchor to same page
Please download the new version (3.0) from our website and try again. You can also try our Liev Demo to see if it works before you download the new version.
  
  25 Jan 2008, 5:29 PM
GCB is not online. Last active: 4/23/2009 1:45:57 PM GCB

Top 10 Posts
Joined on 12-10-2007
Posts 78
Re: Anchor to same page
I did download it.  The behavior is different now, but it is still wrong. Now instead of changing the url to an absolute url it changes it to a relative url by adding the relative subdirectory of the page containing the editor: 

For example, imagine the following scenario:

\___
      \Pages 
         Here.aspx__
                          \
                           \MorePages
                               There.aspx

Here.aspx is in the subdirectory Pages, which is off the site home directory.  There.aspx is in the subdirectory MorePages which is off the subdirectory Pages.

Inside Here.aspx I have a UltimateEditor control in which I type a link to There.aspx. I.e.  <a href="There.aspx">There</a>.  UltimateEditor formerly change that to <a href="http://www.foo.com/Pages/There.aspx">There</a>.

Now it's changing it to <a href="Pages/There.aspx">There</a>.  But 'There.aspx' isn't in Pages, it's in MorePages. 

I have written code in my CMS to change the links myself.  When a relative link is found in dynamic content, I search for the page, or image, or whatever, and I dynamically make it absolute before sending it to the browser.  Then when the user save the content, I dynamically make it relative before storing it in the CMS database. So the user never has to enter either an absolute or relative path for the page on the site, just the page name.  This has the added benefit of allowing me modify the directory arrangment of pages without breaking anything.  But I had to do this to get around the earlier bug.

So I would rather UltimateEditor not change any links at all.  If your changing these links is considered a feature then such a feature definitely should be optional.

As of now I'm going to have to write more code to get around your latest change, because it breaks my CMS.



  
  25 Jan 2008, 5:34 PM
GCB is not online. Last active: 4/23/2009 1:45:57 PM GCB

Top 10 Posts
Joined on 12-10-2007
Posts 78
Re: Anchor to same page
Actually, I did have to laugh when I saw this latest change. 

I can't back out to the earlier version because this is the version you delivered to me when I purchased the Suite this morning. 

Everything else seems to work fine, although I did not expect the changes to UltimateSpell in UltimateEditor, but I was able to figure it out after a while.

  
  29 Jan 2008, 7:13 PM
Karamasoft is not online. Last active: 9/2/2010 12:02:18 PM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 5,325
Re: Anchor to same page
We tried your scenario but couldn't reproduce it. It replaced the link URL as /MorePages/There.aspx when we switched to HTML mode. The new version checks the URL of the link and removes the left part of it if it matches the URL of the page. However, the URLs never start without http or / character. Can you make sure that your code make other changes that might remove the / character in front of the URL?

We might consider adding a property making it optional to remove the left part of the URL. Thanks for your feedback.

  
  30 Jan 2008, 5:07 PM
GCB is not online. Last active: 4/23/2009 1:45:57 PM GCB

Top 10 Posts
Joined on 12-10-2007
Posts 78
Re: Anchor to same page
I don't think you followed what I did quite accurately. 

From what I've seen, if in UE I input only a page name into a link, e.g. href="There.aspx", UE will add to it whatever subdirectory the current page is in, regardless of where "There.aspx" actually is.  If "There.aspx" doesn't happen to be in the same directory as the current page, I am are out of luck.

For UE to get it right it would have to know where on the site There.aspx is, and it can't know that.  You are just assuming There.aspx is in the same directory as the current page.

I'm not sure how it is helpful for you to make this assumption.

  
  31 Jan 2008, 12:29 AM
Karamasoft is not online. Last active: 9/2/2010 12:02:18 PM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 5,325
Re: Anchor to same page

We will add this issue to our product enhancement list. Thanks for your feedback.


  
  01 Feb 2008, 10:21 AM
GCB is not online. Last active: 4/23/2009 1:45:57 PM GCB

Top 10 Posts
Joined on 12-10-2007
Posts 78
Re: Anchor to same page
Thanks!
  
  03 Jun 2008, 6:54 PM
Karamasoft is not online. Last active: 9/2/2010 12:02:18 PM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 5,325
Re: Anchor to same page
With the release of UltimateEditor3.1, anchor to same page issue is now fixed. Please visit the Release History page at http://www.karamasoft.com/UltimateEditor/History.aspx to see the changes and download the latest version from our website and try again.
  
 Page 1 of 1 (15 items)
Karamasoft Support Forums » General Discussions » UltimateEditor » Anchor to same page

You can add attachments
You can post new topics
You can reply to topics
You can delete your posts
You can edit your posts
You can create polls
You can vote in polls
Forum statistics are enabled
Forum is unmoderated

© 2002-2010 Karamasoft LLC. All rights reserved.