href delete by Tiny

General questions relating to Joomla! 3.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Locked
dido
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Fri Apr 21, 2006 7:56 pm

href delete by Tiny

Post by dido » Mon May 21, 2018 8:50 am

I wonna set a href in an article

Code: Select all

<a href="java script:gaOptout()">Click here to opt-out of Google Analytics</a>
after save the article its changed to

Code: Select all

<a>Click here to opt-out of Google Analytics</a>

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44067
Joined: Sat Apr 05, 2008 9:58 pm

Re: href delete by Tiny

Post by Webdongle » Mon May 21, 2018 9:20 am

Plugin options
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

dido
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Fri Apr 21, 2006 7:56 pm

Re: href delete by Tiny

Post by dido » Mon May 21, 2018 2:08 pm

?? very helpful.... which plugin and what kind of options?

dido
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Fri Apr 21, 2006 7:56 pm

Re: href delete by Tiny

Post by dido » Mon May 21, 2018 2:36 pm

if you mean forbidden elements. There i cant delete "script,applet,iframe" is after save again set

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44067
Joined: Sat Apr 05, 2008 9:58 pm

Re: href delete by Tiny

Post by Webdongle » Mon May 21, 2018 3:01 pm

Just checked ... the changes to the plugin aren't being saved. Please raise an issue https://issues.joomla.org/
In the mean time try https://extensions.joomla.org/extension/jce/
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

dido
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Fri Apr 21, 2006 7:56 pm

Re: href delete by Tiny

Post by dido » Mon May 21, 2018 3:11 pm

i dont wonna change the editor, in the meantime i edit it direct in the database :D
I ve no github acc and dont wonna set one, so i cant raise a issue.

User avatar
Jaydot
Joomla! Guru
Joomla! Guru
Posts: 651
Joined: Sun Jun 04, 2017 12:11 pm
Location: The Netherlands
Contact:

Re: href delete by Tiny

Post by Jaydot » Mon May 21, 2018 3:44 pm

@Webdongle: did you remember to choose the correct set? It's working fine for me.

@dido: here's a step by step:
- First: go to Global Config -> Text filters, and make sure that for your user group (probably Super User?) filtering is set to "no filter".
- Then go to Extensions -> Plugins -> TinyMCE, and choose the set for your user group (for Super Users, that's usually Set 0).
- Scroll down and switch "use joomla text filters" on.
- Save and close.
The fact that an opinion is widely held is no evidence whatsoever that it is not utterly absurd.
Personal website: https://jaydot.nl

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44067
Joined: Sat Apr 05, 2008 9:58 pm

Re: href delete by Tiny

Post by Webdongle » Mon May 21, 2018 6:53 pm

@Jaydot
I selected the correct set and removed 'script,applet,iframe' but upon save the 'script,applet,iframe' reappeared. Also tried it with another set but that failed to save the changes as well.

Never tried with 'use joomla text filters' set on.

Question still stands as to why changes to the Tinymce removing 'script,applet,iframe', are not saved ?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
Jaydot
Joomla! Guru
Joomla! Guru
Posts: 651
Joined: Sun Jun 04, 2017 12:11 pm
Location: The Netherlands
Contact:

Re: href delete by Tiny

Post by Jaydot » Mon May 21, 2018 8:43 pm

Ah, I remember struggling with that before I discovered (and embraced :)) "use text filter", but I usually got it to work eventually - not just by removing script etc., but also by adding script etc. als valid elements and even as extended valid elements for good measure. I was never really sure what made it work in the end :'( .
Can't test it, because I removed the prohibited elements before discovering "use text filter" and they are still removed, see image. I never typed "empty", by the way, it was there when I switched "use text filter" off.
You do not have the required permissions to view the files attached to this post.
The fact that an opinion is widely held is no evidence whatsoever that it is not utterly absurd.
Personal website: https://jaydot.nl

User avatar
effrit
Joomla! Guru
Joomla! Guru
Posts: 846
Joined: Sun Nov 12, 2017 2:21 pm
Location: middle of Russia
Contact:

Re: href delete by Tiny

Post by effrit » Mon May 21, 2018 9:13 pm

seems like this settings still not allow paste TS code as 'href' value.
but if you paste code in 'rel' tag it will be ok.
so most easiest way is switch editor to "No editor" in user preference.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44067
Joined: Sat Apr 05, 2008 9:58 pm

Re: href delete by Tiny

Post by Webdongle » Tue May 22, 2018 12:30 pm

effrit wrote:...
so most easiest way is switch editor to "No editor" in user preference.
Problem with that is if you switch to Tinymce (for another edit) and open that one again then it gets stripped again.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
effrit
Joomla! Guru
Joomla! Guru
Posts: 846
Joined: Sun Nov 12, 2017 2:21 pm
Location: middle of Russia
Contact:

Re: href delete by Tiny

Post by effrit » Tue May 22, 2018 1:03 pm

I know, but still it's better than edit text in database.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44067
Joined: Sat Apr 05, 2008 9:58 pm

Re: href delete by Tiny

Post by Webdongle » Tue May 22, 2018 8:05 pm

Better still the option proposed by Jaydot
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
effrit
Joomla! Guru
Joomla! Guru
Posts: 846
Joined: Sun Nov 12, 2017 2:21 pm
Location: middle of Russia
Contact:

Re: href delete by Tiny

Post by effrit » Tue May 22, 2018 8:10 pm

did you try read what i wrote?
seems like this settings still not allow paste TS code as 'href' value.
how can it be better if it didn't work?

User avatar
Jaydot
Joomla! Guru
Joomla! Guru
Posts: 651
Joined: Sun Jun 04, 2017 12:11 pm
Location: The Netherlands
Contact:

Re: href delete by Tiny

Post by Jaydot » Tue May 22, 2018 8:20 pm

Effrit, please see my first post in this thread. Works perfectly.
(My second post was a reply to Webdongle's question about TinyMCE not saving removed elements).
The fact that an opinion is widely held is no evidence whatsoever that it is not utterly absurd.
Personal website: https://jaydot.nl

User avatar
effrit
Joomla! Guru
Joomla! Guru
Posts: 846
Joined: Sun Nov 12, 2017 2:21 pm
Location: middle of Russia
Contact:

Re: href delete by Tiny

Post by effrit » Tue May 22, 2018 8:30 pm

Jaydot, did you try paste code as href value?
i cant make it worked.

unified11
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed May 16, 2018 3:13 pm

Re: href delete by Tiny

Post by unified11 » Tue May 22, 2018 8:39 pm

<a href="https://www.w3schools.com">Visit W3Schools!</a> this the example for hyperlinks

User avatar
Jaydot
Joomla! Guru
Joomla! Guru
Posts: 651
Joined: Sun Jun 04, 2017 12:11 pm
Location: The Netherlands
Contact:

Re: href delete by Tiny

Post by Jaydot » Tue May 22, 2018 8:39 pm

Oops. I tested with the OP's code and I also have problems...
Is that code valid html??
You do not have the required permissions to view the files attached to this post.
The fact that an opinion is widely held is no evidence whatsoever that it is not utterly absurd.
Personal website: https://jaydot.nl

User avatar
effrit
Joomla! Guru
Joomla! Guru
Posts: 846
Joined: Sun Nov 12, 2017 2:21 pm
Location: middle of Russia
Contact:

Re: href delete by Tiny

Post by effrit » Tue May 22, 2018 8:50 pm

i am not sure if TS use right method (i don't remember if i saw code in href before) but still Tiny have special filter for href so disable editor in only 'native' solution i can suggest.

User avatar
Jaydot
Joomla! Guru
Joomla! Guru
Posts: 651
Joined: Sun Jun 04, 2017 12:11 pm
Location: The Netherlands
Contact:

Re: href delete by Tiny

Post by Jaydot » Tue May 22, 2018 9:10 pm

Ah, TS is Topic Starter, that took me a while to understand :).

I'm not a coder, so I have no idea how to href javascript code.
I know I can use href for url's without any problem.
I tried removing the space between java and script, but that didn't work. I suspect the code is not valid, because TinyMCE will ruthlessly strip invalid code.

I wonder if the TS is still following this, and if so, if he tested his code using "no editor"...
The fact that an opinion is widely held is no evidence whatsoever that it is not utterly absurd.
Personal website: https://jaydot.nl

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44067
Joined: Sat Apr 05, 2008 9:58 pm

Re: href delete by Tiny

Post by Webdongle » Tue May 22, 2018 10:03 pm

Code: Select all

java script:gaOptout()
Isn't a valid url for a link
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
Jaydot
Joomla! Guru
Joomla! Guru
Posts: 651
Joined: Sun Jun 04, 2017 12:11 pm
Location: The Netherlands
Contact:

Re: href delete by Tiny

Post by Jaydot » Wed May 23, 2018 9:03 am

Exactly.
However, when using a valid javascript url, the href gets stripped as well (I found an example on https://www.w3schools.com/tags/att_a_href.asp, but pasting it in this post gets blocked by the forum).
Apparently, this is because
https://www.tinymce.com/docs/configure/ ... cript_urls

I haven't figured out how/where to change this, though :). Hints are welcome!
The fact that an opinion is widely held is no evidence whatsoever that it is not utterly absurd.
Personal website: https://jaydot.nl

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44067
Joined: Sat Apr 05, 2008 9:58 pm

Re: href delete by Tiny

Post by Webdongle » Wed May 23, 2018 11:05 am

JCE editor(when configured) doesn't strip the code. If you use it suggest you setup a profile for SU.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".


Locked

Return to “General Questions/New to Joomla! 3.x”