Okay, buddy, hold on, here's what the problem is: A HTML anchor is like a marker on your page. If you want a link to jump to that marker, you need to make the link. Also, when you link to a marker, the page will jump (only if it is long enough!) so that the marker is at the top of the page.
HowTo: 1- Insert your anchor. Suppose we call it Test2. Highlight the appropriate test, use the FCK Anchor button, name it Test2. 2- Insert your link. Anchor links always look like <a href="#MYANCHOR"></a> or <a href="http://www.mydomain.com/myfolder/mypage.ext#MYANCHOR"></a>. Highlight the text that will be the link and click FCK button Insert/Edit link. We want a link of type <other> and we will link it to #Test2. 3- Done.
I tried that, step by step, but I am running FCK in a custom CMS that we built and when i anchor the link then it disappears and this is what shows where the anchor should be :
I have a feeling there is something conflicting with the FCK editor or somethins is not setup correctly. I guess I will have to do it the long hard way and use PHP to generate the anchors,
You are 100% right. This is still true with FCKEditor 2.6 (all comments are relative to the 2.6 codebase)
If you make the code <a href="bob"></a> FCKeditor will eat it at it's first opportunity. Since this is perfectly valid code I'm pretty sure this was an introduced bug while trying to fix SF-BUG 1556878. They tried to fix the outcome not the cause and then removed perfectly valid xhtml in the process.
The easiest way to reproduce this is as follows:
1. Start an FCKEditor. 2. Go to source mode (in FCKEditor) 3. Type in <a href="bob"></a> (note nothing in the contents area of the anchor) 4. Go to WYSIWYG mode. 5. Go back to source mode.
You'll find that your typing has vanished.
Here's the fix. The source file is editor/_source/internals/fckxhtml.js in function FCKXHtml.TagProcessors .
If you remove the following lines the "expected" behavior returns.
// Firefox may create empty tags when deleting the selection in some special cases (SF-BUG 1556878).if( htmlNode.innerHTML.Trim().length ==0&&!htmlNode.name )returnfalse;
The real code that gets run is editor/js/fckeditorcode_gecko.js and editor/js/fckeditorcode_ie.js .
It's a little tricky to edit this because the lines are huge. Remove the following text from both files and you'll be golden:
Re: FCK editor anchor links not working! Please help!
Okay, buddy, hold on, here's what the problem is:
A HTML anchor is like a marker on your page.
If you want a link to jump to that marker, you need to make the link.
Also, when you link to a marker, the page will jump (only if it is long enough!) so that the marker is at the top of the page.
HowTo:
1- Insert your anchor. Suppose we call it Test2. Highlight the appropriate test, use the FCK Anchor button, name it Test2.
2- Insert your link. Anchor links always look like <a href="#MYANCHOR"></a> or <a href="http://www.mydomain.com/myfolder/mypage.ext#MYANCHOR"></a>. Highlight the text that will be the link and click FCK button Insert/Edit link. We want a link of type <other> and we will link it to #Test2.
3- Done.
Re: FCK editor anchor links not working! Please help!
Thx for the reply dude,
I tried that, step by step, but I am running FCK in a custom CMS that we built and when i anchor the link then it disappears and this is what shows where the anchor should be :
<IMG class=FCK__Anchor height=1 src="http://lise.prodg.cc/websites/etsip_www/html//FCKeditor/editor/images/spacer.gif" width=1 _fckanchor="true" _fckrealelement="0" _fckfakelement="true">
I have a feeling there is something conflicting with the FCK editor or somethins is not setup correctly.
I guess I will have to do it the long hard way and use PHP to generate the anchors,
Thx anyway man,
tHYeSteAN
Re: FCK editor anchor links not working! Please help!
If you get that HTML then you are using the innerHTML of the editor, and that's the problem. you MUST use the API
FIXED: FCK empty anchor tags being removed.
If you make the code <a href="bob"></a> FCKeditor will eat it at it's first opportunity. Since this is perfectly valid code I'm pretty sure this was an introduced bug while trying to fix SF-BUG 1556878. They tried to fix the outcome not the cause and then removed perfectly valid xhtml in the process.
The easiest way to reproduce this is as follows:
1. Start an FCKEditor.
2. Go to source mode (in FCKEditor)
3. Type in <a href="bob"></a> (note nothing in the contents area of the anchor)
4. Go to WYSIWYG mode.
5. Go back to source mode.
You'll find that your typing has vanished.
Here's the fix. The source file is editor/_source/internals/fckxhtml.js in function FCKXHtml.TagProcessors .
If you remove the following lines the "expected" behavior returns.
The real code that gets run is editor/js/fckeditorcode_gecko.js and editor/js/fckeditorcode_ie.js .
It's a little tricky to edit this because the lines are huge. Remove the following text from both files and you'll be golden:
I suggest this code somehow makes it into the codebase as a fix. I have no idea where to submit it.
--
Jeffrey Hundstad