How to add Hyperlink Relationships (rel=”") to FCK Editor links
February 26th, 2007I use FCK Editor quite a bit for some of my websites. One thing I use quite often that is not supported by the FCK Editor is the Hyperlink Relationship (<a href=”link.html” rel=”nofollow”>) on links so that it hooks up with Lightbox (if you aren’t using Lightbox, you’re missing out).
I finally decided to have a play around with adding this feature to the FCK Editor and believe it or not, it was easier then I thought…
I’m using FCK Editor 2.4 but I’m pretty sure there won’t be many changes if any between versions.
1. Open editor/dialog/fck_link.html.
This dialog window didn’t have much room to play with so I decided to replace the Advisory Content Type text box with the Hyperlink Relationship. You can replace any of them but I thought this one was useless. I’ve never used it in my life.
Find (line 274):
<td valign=”top”>
<span fckLang=”DlgGenContType”>Advisory Content Type</span><br />
<input id=”txtAttContentType” style=”WIDTH: 100%” type=”text” />
</td>
Replace with:
<td valign=”top”>
<span fckLang=”DlgGenRel”>Hyperlink Relationship</span><br />
<input id=”txtAttRel” style=”WIDTH: 100%” type=”text” />
</td>
2. Open editor/dialog/fck_link/fck_link.js.
Find (line 284):
GetE(’txtAttContentType’).value = oLink.type ;
Replace with:
GetE(’txtAttRel’).value = oLink.rel ;
Find (line 542):
SetAttribute( oLink, ‘type’ , GetE(’txtAttContentType’).value ) ;
Replace with:
SetAttribute( oLink, ‘rel’ , GetE(’txtAttRel’).value ) ;
3. Open editor/lang/en.js.
Note: Change en.js to the language of your choice if you’re using another language.
Find (line 172):
DlgGenContType : “Advisory Content Type”,
Replace with:
DlgGenRel : “Rel”,
4. That’s it!
Clear your temporary internet files/cache and test it out.