Inserting PHP and JavaScript code in Joomla 1.6 articles
-
- Joomla! Apprentice
- Posts: 10
- Joined: Mon Sep 07, 2009 5:28 am
Inserting PHP and JavaScript code in Joomla 1.6 articles
I am unable to insert PHP and JavaScript code in Joomla 1.6 articles. The code gets stripped upon saving even I set the TinyMCE settings in the Plug-in Manager as follows:
Cleanup code on load: Off
Clean code on Save: Never
I've also removed javascript, iframe from Prohibited Elements.
With the above settings, I am still unable to insert PHP and/or JavaScript code in articles. Is there a way to do this in Joomla 1.6?
Cleanup code on load: Off
Clean code on Save: Never
I've also removed javascript, iframe from Prohibited Elements.
With the above settings, I am still unable to insert PHP and/or JavaScript code in articles. Is there a way to do this in Joomla 1.6?
-
- Joomla! Fledgling
- Posts: 3
- Joined: Fri Jan 21, 2011 6:27 pm
Re: Inserting PHP and JavaScript code in Joomla 1.6 articles
The quickest and easiest route to including code in content is to have a spare user account set up without any editor, and include that user in a group for which there are no blacklisted tags.
You set blacklist/whitelist tags in:
Article Manager --> Options --> Set Filter Groups to No Filtering for the access level of your spare user. (Best to use a Super User account for this if you can.)
John Hobart
You set blacklist/whitelist tags in:
Article Manager --> Options --> Set Filter Groups to No Filtering for the access level of your spare user. (Best to use a Super User account for this if you can.)
John Hobart
-
- Joomla! Fledgling
- Posts: 2
- Joined: Mon Jan 24, 2011 4:32 pm
Re: Inserting PHP and JavaScript code in Joomla 1.6 articles
Hi,
I have exactly the same problem with joomla 1.6, i tryed all possible options (no filter with superuser, administrator ... ) this and the editors still delete java and <embed>..
editors : none, tinyMCE, artof ..
i'm the superuser and it is the default superuser account, unregistred. Do i have to registre it ?
i want to put a flv or mp4 video into an article, i try to use the JWPLAYER, and i can't put a embed or java code, all editors always delete the code as soon as i save it .
Someone have an idea ?
(sorry for my bad english)
thx
I have exactly the same problem with joomla 1.6, i tryed all possible options (no filter with superuser, administrator ... ) this and the editors still delete java and <embed>..
editors : none, tinyMCE, artof ..
i'm the superuser and it is the default superuser account, unregistred. Do i have to registre it ?
i want to put a flv or mp4 video into an article, i try to use the JWPLAYER, and i can't put a embed or java code, all editors always delete the code as soon as i save it .
Someone have an idea ?
(sorry for my bad english)
thx
-
- Joomla! Fledgling
- Posts: 3
- Joined: Fri Jan 21, 2011 6:27 pm
Re: Inserting PHP and JavaScript code in Joomla 1.6 articles
Article Manager --> Options --> Set Filter Groups
You need to set the filter groups. See my earlier post.
You need to set the filter groups. See my earlier post.
-
- Joomla! Fledgling
- Posts: 2
- Joined: Mon Jan 24, 2011 4:32 pm
Re: Inserting PHP and JavaScript code in Joomla 1.6 articles
Hello Jhobart,
i understood your earlier post and already done. There isn't an 'option' buttom with 1.6, there is parameters -> filter groups, and i'd put administrator and super user to "no filter".
the same for TinyMCE settings in the Plug-in Manager:
Cleanup code on load: Off
Clean code on Save: Never
And nothing change (of course i always saved when i change option !).
when i use "no editor" or artof, embed or java disapear whan i save.
Is there a cache system somewhere ? Cache is diseable into the configuration panel (off)
this thing drive me crazy !
thx
i understood your earlier post and already done. There isn't an 'option' buttom with 1.6, there is parameters -> filter groups, and i'd put administrator and super user to "no filter".
the same for TinyMCE settings in the Plug-in Manager:
Cleanup code on load: Off
Clean code on Save: Never
And nothing change (of course i always saved when i change option !).
when i use "no editor" or artof, embed or java disapear whan i save.
Is there a cache system somewhere ? Cache is diseable into the configuration panel (off)
this thing drive me crazy !
thx
-
- Joomla! Fledgling
- Posts: 3
- Joined: Fri Jan 21, 2011 6:27 pm
Re: Inserting PHP and JavaScript code in Joomla 1.6 articles
Hey Mr. 13,
Can you paste the code you're trying to insert here? If that's not an option, you can send it to me at jhobart at synergycode dot com.
Thanks,
John
Can you paste the code you're trying to insert here? If that's not an option, you can send it to me at jhobart at synergycode dot com.
Thanks,
John
-
- Joomla! Fledgling
- Posts: 2
- Joined: Sun Jan 30, 2011 11:55 pm
Re: Inserting PHP and JavaScript code in Joomla 1.6 articles
I am having the same problem. Settings for TinyMCE are Cleanup code on load: Off
Clean code on Save: Never HTML:raw and all filters set to raw. Javascript is stripped no matter how I add it. This is the code I have been using for testing:-
And the result is always the same:-
Clean code on Save: Never HTML:raw and all filters set to raw. Javascript is stripped no matter how I add it. This is the code I have been using for testing:-
Code: Select all
<p>Some text
<span onclick="alert('hello world');">
click me</span></p>
<p>This is how we add a
<a href="javascript:alert('hello world');">
game</a></p>
<p>Some more text</p>
<script>
alert('hello world');
</script>
<p>Some more text</p>
Code: Select all
<p>Some text
<span>
click me</span></p>
<p>This is how we add a
<a>
game</a></p>
<p>Some more text</p>
<p>Some more text</p>
-
- Joomla! Fledgling
- Posts: 2
- Joined: Sun Jan 30, 2011 11:55 pm
Re: Inserting PHP and JavaScript code in Joomla 1.6 articles
oops, my bad. The <script> tag is only stripped when saving without the TinyMCE editor (ie Global Config is set to use no editor).
-
- Joomla! Fledgling
- Posts: 2
- Joined: Mon Feb 07, 2011 3:58 pm
Re: Inserting PHP and JavaScript code in Joomla 1.6 articles
I'm having the same issue with 1.6, trying to insert this code into an article. My code either simply appears as text, or nothing shows up at all for the article (either in the editor or on the webpage itself). I'm a total newbie here, so I'm just hoping/thinking that this is all due to my own ignorance.
I've configured tinyMCE with clean code on load=off, clean code on save=never, entity coding= raw, and I've removed all prohibited elements from the prohibited elements field (although they reappear after saving?). I've also tried setting the editor to none, and codemirror, but no luck.
I've configured the article manager settings to have no filtering for any groups (just to test). No luck.
Here' what I'm trying to paste into an article (I've tried just pasting it into the article, and pasting it in via the HTML editor link, but no change in result):
<link type="text/css" rel="stylesheet" href="/script/css/calendar.css" />
<link type="text/css" rel="stylesheet" href="/script/ajax.php?controller=calendars&action=css&cid=1" />
<script type="text/javascript" src="/script/js/custom.js"></script>
<script type="text/javascript" src="/script/js/front.js"></script>
<script type="text/javascript" src="/script/load.php?cid=1&view=3"></script>
Anything else that I should be doing? Maybe something I'm supposed to be inserting into the code besides what's shown above? The "script" directory referenced above is in the root directory where the joomla site files are installed.
Thanks in advance for the use of your brains.
Ted
I've configured tinyMCE with clean code on load=off, clean code on save=never, entity coding= raw, and I've removed all prohibited elements from the prohibited elements field (although they reappear after saving?). I've also tried setting the editor to none, and codemirror, but no luck.
I've configured the article manager settings to have no filtering for any groups (just to test). No luck.
Here' what I'm trying to paste into an article (I've tried just pasting it into the article, and pasting it in via the HTML editor link, but no change in result):
<link type="text/css" rel="stylesheet" href="/script/css/calendar.css" />
<link type="text/css" rel="stylesheet" href="/script/ajax.php?controller=calendars&action=css&cid=1" />
<script type="text/javascript" src="/script/js/custom.js"></script>
<script type="text/javascript" src="/script/js/front.js"></script>
<script type="text/javascript" src="/script/load.php?cid=1&view=3"></script>
Anything else that I should be doing? Maybe something I'm supposed to be inserting into the code besides what's shown above? The "script" directory referenced above is in the root directory where the joomla site files are installed.
Thanks in advance for the use of your brains.
Ted
-
- Joomla! Apprentice
- Posts: 11
- Joined: Mon Feb 02, 2009 11:08 am
Re: Inserting PHP and JavaScript code in Joomla 1.6 articles
I agree with the previous writers: Setting the article filter groups (to "no filter") doesn't work!
Bug altert?
Example:
<p>
<script src="http://lite.piclens.com/current/piclens.js" type="text/javascript"></script>
<ul class="p2">
<li> <a href="javascript:PicLensLite.start({feedUrl:'/galerij/Bonaire.rss'});" target="_parent"> Bonaire 2008 </a> </li>
</ul>
</p>
changes to:
<p> </p>
<ul class="p2">
<li> <a target="_parent"> Bonaire 2008 </a> </li>
</ul>
<p> </p>
With all the filters set to "no filter".
Bug altert?
Example:
<p>
<script src="http://lite.piclens.com/current/piclens.js" type="text/javascript"></script>
<ul class="p2">
<li> <a href="javascript:PicLensLite.start({feedUrl:'/galerij/Bonaire.rss'});" target="_parent"> Bonaire 2008 </a> </li>
</ul>
</p>
changes to:
<p> </p>
<ul class="p2">
<li> <a target="_parent"> Bonaire 2008 </a> </li>
</ul>
<p> </p>
With all the filters set to "no filter".
-
- Joomla! Fledgling
- Posts: 2
- Joined: Mon Feb 07, 2011 3:58 pm
Re: Inserting PHP and JavaScript code in Joomla 1.6 articles
Looks like someone's looking into this bug for 1.6 (opened on Jan 22, 2011):
http://joomlacode.org/gf/project/joomla ... m_id=24545
http://joomlacode.org/gf/project/joomla ... m_id=24545
-
- Joomla! Apprentice
- Posts: 46
- Joined: Sat Mar 07, 2009 1:18 pm
Re: Inserting PHP and JavaScript code in Joomla 1.6 articles
The patch at the bottom of the page on Tedly's link worked for my Joomla 1.6 installation.
<-- --> tags are no longer removed.
It doesn't strip my php tags either.
I'm using no editor and have given my user account no filter settings.
Simply awesome!!!!
<-- --> tags are no longer removed.
It doesn't strip my php tags either.
I'm using no editor and have given my user account no filter settings.
Simply awesome!!!!
- jmgroud
- Joomla! Apprentice
- Posts: 25
- Joined: Fri Apr 22, 2011 9:16 pm
- Location: Paris (France)
- Contact:
Re: Inserting PHP and JavaScript code in Joomla 1.6 articles
Hello
Maybe it's possible to use the plugin 'jumi' (http://edo.webmaster.am/jumi)
Maybe it's possible to use the plugin 'jumi' (http://edo.webmaster.am/jumi)
Le peu que je sais est occulté par le trop que je ne sais pas...