You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Online

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

#116540 issue setting a link on font awesome icon

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by Ryan on Wednesday, 15 May 2024 14:36 BST

zetcom
First of all, thank you for adding the fontawesome plugin! Great, I love it! :D

Inserting fontawesome icons works fine. However, there is a problem with adding links to those icons.
Unfortunately, adding a link is not possible in the "editor view" of JCE.
You can set a link in the "code view" and it will remain when you save - but only if the article is saved from the "code view".
If you switch to the editor view and click save, JCE removes the link from the icon.

It looks like the code is being cleaned up and <a> tags are not allowed on <span> tags.
Is there a setting somewhere that prevents this?

Ryan
In order to improve selection of icons, and cursor placement around them, I changed from using a <span> tag for the icons in the editor to an anchor tag <a>. The <a> tag would then be converted to a <span> when the content was saved.

This works really well, except I forgot about the possibility of creating a link on an icon, and nested <a> tags are not supported!

I'm having another look at this, and will probably revert to using <span> tags in all instances. I'll keep you posted.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

zetcom

Hi Ryan.

In the latest update JCE Pro 2.9.71 you changed the implementation of fontawesome? The icons now appear in a <span>-Tag.

However, it still is not possible to put a link on that. The <a>-Tag automatically is removed from <span> on Save.

I'm sorry if I missed something, but is there a way to fix it?

Ryan

However, it still is not possible to put a link on that. The <a>-Tag automatically is removed from <span> on Save.

Is the link still visible when you click the Code tab?

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

zetcom

Yes, in the code tab it is possible to set a link on the <span>-tag. As soon as you switch to Editor tab and click Save, the link is removed.

Ryan

What I mean is, if you set the link in the Editor tab, then switch to the Code tab, is the link still visible in the code?

Also, do you have Font Awseome 1.1.4 installed? - https://www.joomlacontenteditor.net/downloads/plugins/font-awesome-for-jce

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

zetcom

uhm.. in that case, the <span>-tag is removed and the <a>-tag remains there with an &nspb; in between. In the editor-tab it's a bit difficult to select the fontawesome icon in order to put a link on it.

Ryan

You can select the icon by clicking on it or just to the right of it, and it will be highlighted blue. You can then click the Link button to apply a link to it.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.