How to include PHP and javascript code in articles ?
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
-
- Joomla! Apprentice
- Posts: 5
- Joined: Sun Mar 09, 2008 3:46 pm
How to include PHP and javascript code in articles ?
Hey there !
Can some one answer these questions ?
1) How to include PHP and JAVASCRIPT code in articles , so i can embed registration form in articles. I am creating a college cultural website and i need to embed registration form for each event .
2) How to add a navigation bar inside a article ? This is how i want the look to be . I am attaching the images
Link to site : http://kurukshetra.org.in/events/index.php
Please help me, i need your help !!! Very Urgent !
Can some one answer these questions ?
1) How to include PHP and JAVASCRIPT code in articles , so i can embed registration form in articles. I am creating a college cultural website and i need to embed registration form for each event .
2) How to add a navigation bar inside a article ? This is how i want the look to be . I am attaching the images
Link to site : http://kurukshetra.org.in/events/index.php
Please help me, i need your help !!! Very Urgent !
- MarHaj
- Joomla! Ace
- Posts: 1168
- Joined: Fri Jun 30, 2006 5:24 pm
- Location: CZ
- Contact:
Re: How to include PHP and javascript code in articles ?
You need a content plugin for this.How to include PHP and javascript code in articles ?
Try Jumi extension http://extensions.joomla.org/component/ ... Itemid,35/
or find another "from tools" plugin that suit best to your needs: http://extensions.joomla.org/component/ ... Itemid,35/
MarHaj
-
- Joomla! Apprentice
- Posts: 19
- Joined: Fri Feb 22, 2008 2:54 am
Re: How to include PHP and javascript code in articles ?
Hi Martin,
I've been using Joomla for the past 2 weeks, I'm not totally familiar with it, and I'm facing the same problem like the thread starter. So lucky there's Jumi.
Im very new to the Jumi,
I have problem to understand how it works...
i have read through the tutorial site, the demo shows that
{jumi [somepath/hello_args.php] [Hello World!]}
Let's say i put my php file at c:\wamp\www\Prototype\jumies\hello_args.php
so... how am i going to replace my path at the [somepath/hello_args.php]?
i have tried, [..Prototype/jumies/hellow_args.php] but it's not working.
Would you enlighten me pls?
I've been using Joomla for the past 2 weeks, I'm not totally familiar with it, and I'm facing the same problem like the thread starter. So lucky there's Jumi.
Im very new to the Jumi,
I have problem to understand how it works...
i have read through the tutorial site, the demo shows that
{jumi [somepath/hello_args.php] [Hello World!]}
Let's say i put my php file at c:\wamp\www\Prototype\jumies\hello_args.php
so... how am i going to replace my path at the [somepath/hello_args.php]?
i have tried, [..Prototype/jumies/hellow_args.php] but it's not working.
Would you enlighten me pls?
- MarHaj
- Joomla! Ace
- Posts: 1168
- Joined: Fri Jun 30, 2006 5:24 pm
- Location: CZ
- Contact:
Re: How to include PHP and javascript code in articles ?
The path to the file you shoul write down is a relative path to the file with respect to the Joomla root in current Jumi releases.
Examples
a) If your Joomla root (i.e. where configuration.php and index.php is) is c:/wamp/www/Prototype
and your hello_args.php is at c:\wamp\www\Prototype\jumies\hello_args.php
then
{jumi [jumies/hello_args.php]}
will work.
b) If your Joomla root (i.e. where configuration.php and index.php is) is c:/wamp/www
and your hello_args.php is at c:\wamp\www\Prototype\jumies\hello_args.php
then
{jumi [Prototype/jumies/hello_args.php]}
will work.
Examples
a) If your Joomla root (i.e. where configuration.php and index.php is) is c:/wamp/www/Prototype
and your hello_args.php is at c:\wamp\www\Prototype\jumies\hello_args.php
then
{jumi [jumies/hello_args.php]}
will work.
b) If your Joomla root (i.e. where configuration.php and index.php is) is c:/wamp/www
and your hello_args.php is at c:\wamp\www\Prototype\jumies\hello_args.php
then
{jumi [Prototype/jumies/hello_args.php]}
will work.
MarHaj
-
- Joomla! Apprentice
- Posts: 19
- Joined: Fri Feb 22, 2008 2:54 am
Re: How to include PHP and javascript code in articles ?
Thank you!!!!! Quite busy recently, that's why only now I post this thank you, hope you don't mind
- MarHaj
- Joomla! Ace
- Posts: 1168
- Joined: Fri Jun 30, 2006 5:24 pm
- Location: CZ
- Contact:
Re: How to include PHP and javascript code in articles ?
No need to apologize yourself. I really appreciate your acknowledgments whenever they come.
MarHaj
-
- Joomla! Apprentice
- Posts: 8
- Joined: Sun Nov 02, 2008 10:28 am
Re: How to include PHP and javascript code in articles ?
Hi,
thanks for all the help provided. I would like to check if I am following the proper way with including a .js file.
I have a library file in javascript I would like to use. I have done the following:
- installed jumi
- I have uploaded my file using docman. I could also use the image uploader. Is that a good policy?
- enabled the JCE to include javascript
- and then included:
<script type="text/javascript">{jumi [dmdocuments/funcs.js]}</script>
And it works!
Is there anything I could improve?
Thanks!!
thanks for all the help provided. I would like to check if I am following the proper way with including a .js file.
I have a library file in javascript I would like to use. I have done the following:
- installed jumi
- I have uploaded my file using docman. I could also use the image uploader. Is that a good policy?
- enabled the JCE to include javascript
- and then included:
<script type="text/javascript">{jumi [dmdocuments/funcs.js]}</script>
And it works!
Is there anything I could improve?
Thanks!!
- MarHaj
- Joomla! Ace
- Posts: 1168
- Joined: Fri Jun 30, 2006 5:24 pm
- Location: CZ
- Contact:
Re: How to include PHP and javascript code in articles ?
I am usually using FTP client. Like Filezilla. But any method of uploading a file into the server is fine (if it works). Rem: for security purpose (not allowing people to view and stole your files) put into each directory empty index.html file.I have uploaded my file using docman. I could also use the image uploader. Is that a good policy?
With respect to this problem hardly. And with respect to other sites of your life? Who knows?;)Is there anything I could improve?
MarHaj
-
- Joomla! Apprentice
- Posts: 8
- Joined: Sun Nov 02, 2008 10:28 am
Re: How to include PHP and javascript code in articles ?
Haha!
My psicotherapist says I shouldn't worry so much about improving. That worries me.
Thanks
My psicotherapist says I shouldn't worry so much about improving. That worries me.
Thanks
-
- Joomla! Apprentice
- Posts: 7
- Joined: Thu Feb 14, 2008 6:45 pm
Re: How to include PHP and javascript code in articles ?
Hi MarHaj !
Well, I wasn´t so lucky (or wise!) with Jumi...
From the documentation I figured this is a piece of well structured quality Joomla software.
But I tried all three ways to use it (via a module, via a content item with the plugin syntax and from a js file stored in the default joomla root directory) an the result was always the same: whenever the item was published it blocked my whole front-page (where I need to put it).
My application is very simple, similar to a Google AdSense, but from a local Brazilian ad company named boobox (boobox.com).
Can you help me get this solved ? I simply don´t know where to look and I have to get this job done by tomorrow.
Tks a lot !
Well, I wasn´t so lucky (or wise!) with Jumi...
From the documentation I figured this is a piece of well structured quality Joomla software.
But I tried all three ways to use it (via a module, via a content item with the plugin syntax and from a js file stored in the default joomla root directory) an the result was always the same: whenever the item was published it blocked my whole front-page (where I need to put it).
My application is very simple, similar to a Google AdSense, but from a local Brazilian ad company named boobox (boobox.com).
Can you help me get this solved ? I simply don´t know where to look and I have to get this job done by tomorrow.
Tks a lot !
- MarHaj
- Joomla! Ace
- Posts: 1168
- Joined: Fri Jun 30, 2006 5:24 pm
- Location: CZ
- Contact:
Re: How to include PHP and javascript code in articles ?
Lguilherme,whenever the item was published it blocked my whole front-page (where I need to put it).
I wish I could help.
You have a rather strict need: by tomorrow.
I am afraid I am busy right now and will be available just few hours these two days.
Nevertheless we could try it.
Could you be more specific with "blocking". Or better: send me an email (admin at vedeme.cz) with your code attached. I will have a look at it and let you know (rem - I am leaving now and will be back in 12 hours).
MarHaj
-
- Joomla! Fledgling
- Posts: 2
- Joined: Wed Jul 08, 2009 4:02 pm
Re: How to include PHP and javascript code in articles ?
Hello Martin,
I tried to use jumi plugin and used following code in my article.
{jumi [form_handler/form_handler.php]
and when I browse to article it simple print out the same line. As far pathing is concern I can access this form_handler.php page using following URL
http://localhost/site_name/form_handler ... andler.php
Can you give me some suggestion what I may be missing or doing wrong.
Thanks,
I tried to use jumi plugin and used following code in my article.
{jumi [form_handler/form_handler.php]
and when I browse to article it simple print out the same line. As far pathing is concern I can access this form_handler.php page using following URL
http://localhost/site_name/form_handler ... andler.php
Can you give me some suggestion what I may be missing or doing wrong.
Thanks,
- MarHaj
- Joomla! Ace
- Posts: 1168
- Joined: Fri Jun 30, 2006 5:24 pm
- Location: CZ
- Contact:
Re: How to include PHP and javascript code in articles ?
Hi,{jumi [form_handler/form_handler.php] and when I browse to article it simple print out the same line.
there can be several reasons there.
a) Jumi 2.0 plugin syntax differs from that of 2.1
for 2.0: {jumi [form_handler/form_handler.php]}
for 2.1: {jumi form_handler/form_handler.php}{/jumi}
c) Verify the between left curly brace and word jumi is no space
d) Verify that plugin is published in the admin backend
e) Several templates are known to have problems with curly bracket plugins. Try, just for verification if something changes, Joomla default.
MarHaj
-
- Joomla! Fledgling
- Posts: 2
- Joined: Wed Jul 08, 2009 4:02 pm
Re: How to include PHP and javascript code in articles ?
Hello Martin,
Thanks for your answer. The problem was not with template; it was because of an invisible character between "{jumi" and the next brace "[". It was becasue I cut paseted the syntax.
Thanks for your help.
Thanks for your answer. The problem was not with template; it was because of an invisible character between "{jumi" and the next brace "[". It was becasue I cut paseted the syntax.
Thanks for your help.
-
- Joomla! Apprentice
- Posts: 9
- Joined: Wed Nov 11, 2009 11:56 am
Re: How to include PHP and javascript code in articles ?
Hi. I read these posts and decided to install Jumi for v1.5
I have a file /www/africawebforce.com/plugins/Simple RSS Feeder/mod_jw_srfr.php
In my article I have syntax : {jumi [plugins/Simple RSS Feeder/mod_jw_srfr.php]}
I get the following error code :
Africa Web Force
Warning: require_once(/home/davhart/public_html/africawebforce.com/modules/mod_jw_srfr/mod_jw_srfr/simplepie.inc) [function.require-once]: failed to open stream: No such file or directory in /home/davhart/public_html/africawebforce.com/plugins/Simple RSS Feeder/mod_jw_srfr.php on line 59
Fatal error: require_once() [function.require]: Failed opening required '/home/davhart/public_html/africawebforce.com/modules/mod_jw_srfr/mod_jw_srfr/simplepie.inc' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/davhart/public_html/africawebforce.com/plugins/Simple RSS Feeder/mod_jw_srfr.php on line 59
Please can you help me on this :-)
Dave
I have a file /www/africawebforce.com/plugins/Simple RSS Feeder/mod_jw_srfr.php
In my article I have syntax : {jumi [plugins/Simple RSS Feeder/mod_jw_srfr.php]}
I get the following error code :
Africa Web Force
Warning: require_once(/home/davhart/public_html/africawebforce.com/modules/mod_jw_srfr/mod_jw_srfr/simplepie.inc) [function.require-once]: failed to open stream: No such file or directory in /home/davhart/public_html/africawebforce.com/plugins/Simple RSS Feeder/mod_jw_srfr.php on line 59
Fatal error: require_once() [function.require]: Failed opening required '/home/davhart/public_html/africawebforce.com/modules/mod_jw_srfr/mod_jw_srfr/simplepie.inc' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/davhart/public_html/africawebforce.com/plugins/Simple RSS Feeder/mod_jw_srfr.php on line 59
Please can you help me on this :-)
Dave
- MarHaj
- Joomla! Ace
- Posts: 1168
- Joined: Fri Jun 30, 2006 5:24 pm
- Location: CZ
- Contact:
Re: How to include PHP and javascript code in articles ?
Hi Dave,
it seems to me that the script mod_jw_srfr.php is trying to include another file, namely /home/davhart/public_html/africawebforce.com/modules/mod_jw_srfr/mod_jw_srfr/simplepie.inc on line 59. But it fails.
Either verify the file simplepie.inc exists there or change (on the line) path to it.
And verify that has "read" permission too.
it seems to me that the script mod_jw_srfr.php is trying to include another file, namely /home/davhart/public_html/africawebforce.com/modules/mod_jw_srfr/mod_jw_srfr/simplepie.inc on line 59. But it fails.
Either verify the file simplepie.inc exists there or change (on the line) path to it.
And verify that has "read" permission too.
MarHaj
-
- Joomla! Apprentice
- Posts: 9
- Joined: Wed Nov 11, 2009 11:56 am
Re: How to include PHP and javascript code in articles ?
HI Martin. Thanks for the info and help :-) I just found it strange that the plugin is referring to a file that doesn't exist. I will attempt a fix :-)
Dave
Dave
- MarHaj
- Joomla! Ace
- Posts: 1168
- Joined: Fri Jun 30, 2006 5:24 pm
- Location: CZ
- Contact:
Re: How to include PHP and javascript code in articles ?
When including 3rd party files by Jumi it is "normal" behavior.I just found it strange that the plugin
It is because when a file is included by Jumi she "forgets" its real location. She things she belongs to a Joomla! page from the beginning of the world and she believes her motherland is Joomla! root.
So you have to often rewrite files - those lines in them that are referencing other files. It is probably your case.
MarHaj
-
- Joomla! Apprentice
- Posts: 9
- Joined: Wed Nov 11, 2009 11:56 am
Re: How to include PHP and javascript code in articles ?
Thanks Martin. I appreciate your input here. Very nice to have an 'oracle' to consult :-)
-
- Joomla! Apprentice
- Posts: 15
- Joined: Fri Dec 04, 2009 11:52 am
Re: How to include PHP and javascript code in articles ?
MarHaj wrote:You need a content plugin for this.How to include PHP and javascript code in articles ?
Try Jumi extension http://extensions.joomla.org/component/ ... Itemid,35/
or find another "from tools" plugin that suit best to your needs: http://extensions.joomla.org/component/ ... Itemid,35/
But how does it works.I have installed it.it's coming in the list of modules in module manager.what next i have my php form ready.
-
- Joomla! Apprentice
- Posts: 5
- Joined: Tue Jul 07, 2009 7:38 am
Re: How to include PHP and javascript code in articles ?
Hi Friends,
I have installed jumi component.When i click on Jumi coponent(Jumi Applications Manager ), there is two articles.Also, Jumi module installed. I want to display contents using jumi module.So, I enabled Jumi module and in module parameters, added Source of code as {jumi [hello_args.php]}, hello_args.php is in the joomla root directory.And in Advanced Parameters, Default Absolute Jumi Path as /home/servername/htdocs/newjoomla.
But it displays the error,
File /home/servername/htdocs/newjoomla/{jumi [hello_args.php]} does not exist or is not readable!
Can anyone help me?
Thanks,
Rabiya
I have installed jumi component.When i click on Jumi coponent(Jumi Applications Manager ), there is two articles.Also, Jumi module installed. I want to display contents using jumi module.So, I enabled Jumi module and in module parameters, added Source of code as {jumi [hello_args.php]}, hello_args.php is in the joomla root directory.And in Advanced Parameters, Default Absolute Jumi Path as /home/servername/htdocs/newjoomla.
But it displays the error,
File /home/servername/htdocs/newjoomla/{jumi [hello_args.php]} does not exist or is not readable!
Can anyone help me?
Thanks,
Rabiya
- revive1
- Joomla! Intern
- Posts: 87
- Joined: Sat Apr 12, 2008 1:41 am
Re: How to include PHP and javascript code in articles ?
If this portion of the code is viewable in your page error: {jumi [hello_args.php]}
Than you probably have a plugin that is not enabled. Check to make sure you Jumi plugin is enabled and configured correctly.. that should fix it.
Than you probably have a plugin that is not enabled. Check to make sure you Jumi plugin is enabled and configured correctly.. that should fix it.
My favorite web design/dev tools:
Rackspace Cloud Files + Cloud9 http://cloud9manager.com
24" iMac, MAMP Pro, Logitech MX Revolution, Coda, TextMate, Transmit, Snippley and Adobe CS4
For small ecommerce: http://nanao-cart.com
Rackspace Cloud Files + Cloud9 http://cloud9manager.com
24" iMac, MAMP Pro, Logitech MX Revolution, Coda, TextMate, Transmit, Snippley and Adobe CS4
For small ecommerce: http://nanao-cart.com
-
- Joomla! Apprentice
- Posts: 5
- Joined: Tue Jul 07, 2009 7:38 am
Re: How to include PHP and javascript code in articles ?
Hi Friends,
Jumi plugin was already enabled...
I have attached the screenshot here.. Thanks,
Rabiya.
Jumi plugin was already enabled...
I have attached the screenshot here.. Thanks,
Rabiya.
You do not have the required permissions to view the files attached to this post.
-
- Joomla! Apprentice
- Posts: 15
- Joined: Tue Nov 17, 2009 8:44 pm
Re: How to include PHP and javascript code in articles ?
Can I write databse code in a php file and then include it in a article and can make database processing possible. Please reply
-
- Joomla! Apprentice
- Posts: 46
- Joined: Tue Nov 14, 2006 10:21 pm
Re: How to include PHP and javascript code in articles ?
Hi
It looks like I may be able to use Jumi to include a sortable table javascript, which I found here:
http://www.webtoolkit.info/sortable-html-table.html
But I'm not sure how to use the component. Before I spend several hours figuring what to do, can someone kindly advise on whether my ambitions are possible ?
cheers,
Toby
It looks like I may be able to use Jumi to include a sortable table javascript, which I found here:
http://www.webtoolkit.info/sortable-html-table.html
But I'm not sure how to use the component. Before I spend several hours figuring what to do, can someone kindly advise on whether my ambitions are possible ?
cheers,
Toby
-
- Joomla! Apprentice
- Posts: 46
- Joined: Tue Nov 14, 2006 10:21 pm
Re: How to include PHP and javascript code in articles ?
In case anyone else wants similar functionality - it turned out to be quite straight forward with Jumi. Include the js file in the main web root directory, or any other directory you want to reference, then put the table code inside the Jumi component. Call the content using, for example, {jumi 4} and the code stored in the DB 4 is rendered with the js file included for that page. Excellent.
-
- Joomla! Fledgling
- Posts: 3
- Joined: Sat Nov 06, 2010 9:51 am
Re: How to include PHP and javascript code in articles ?
I can't seem to get this to work.
I have jumi joomla v1.5 installed with jumi 2.0
I have the following code in my jumi file (and I tried various changes)
<html>
<body>
<?php
{jumi[*1]}
?>
</body>
</html>
I also tried files outside of a joomla table like the jumi-demo php-file
<html>
<body>
<?php
{jumi [plugins/content/jumi/jumi_demo.php]}
?>
</body>
</html>
I tried it with and without the html and body tags. I tried it with those tags inside or outside (like in the examples here) the included code. What am I doing fundamentally wrong here? I have no clue anymore. These are not even my codes I try to include, it's standard examples from jumi itself.
help would be greatly appreciated
I have jumi joomla v1.5 installed with jumi 2.0
I have the following code in my jumi file (and I tried various changes)
<html>
<body>
<?php
{jumi[*1]}
?>
</body>
</html>
I also tried files outside of a joomla table like the jumi-demo php-file
<html>
<body>
<?php
{jumi [plugins/content/jumi/jumi_demo.php]}
?>
</body>
</html>
I tried it with and without the html and body tags. I tried it with those tags inside or outside (like in the examples here) the included code. What am I doing fundamentally wrong here? I have no clue anymore. These are not even my codes I try to include, it's standard examples from jumi itself.
help would be greatly appreciated
-
- Joomla! Apprentice
- Posts: 20
- Joined: Tue Jan 11, 2011 3:20 pm
Re: How to include PHP and javascript code in articles ?
Hi everybody,
I m stuck'd with editing PHP code in article.
I have web page called enrollment in my website, where i fill the form and submit.
as soon as i submit, the data should be in my database. i use WAMP as my server.
when i click on submit button.
I get the following error message:
"404 Forbidden
You don't have permission to access /joomla/< on this server."
Can you please help me at this point. its urgent!!!!
Cheers
Roops
I m stuck'd with editing PHP code in article.
I have web page called enrollment in my website, where i fill the form and submit.
as soon as i submit, the data should be in my database. i use WAMP as my server.
when i click on submit button.
I get the following error message:
"404 Forbidden
You don't have permission to access /joomla/< on this server."
Can you please help me at this point. its urgent!!!!
Cheers
Roops
-
- Joomla! Apprentice
- Posts: 46
- Joined: Tue Nov 14, 2006 10:21 pm
Re: How to include PHP and javascript code in articles ?
Try it without the php tags too. The idea is that {jumi [*1]} calls the code from your jumi component. I didn't use php tags when I wanted to include code just used the plugin and referenced the pre-stored entry I wanted to include. Although I'm no expert so I may have misunderstood what your problem is.sleenee wrote:I can't seem to get this to work.
<html>
<body>
<?php
{jumi[*1]}
?>
</body>
</html>
I tried it with and without the html and body tags. I tried it with those tags inside or outside (like in the examples here) the included code. What am I doing fundamentally wrong here? I have no clue anymore. These are not even my codes I try to include, it's standard examples from jumi itself.
help would be greatly appreciated
-
- Joomla! Apprentice
- Posts: 46
- Joined: Tue Nov 14, 2006 10:21 pm
Re: How to include PHP and javascript code in articles ?
Being stuck'd is no fun. Presumably when you say editing php in your article you mean including it via Jumi ? Obviously the idea of Joomla is that you don't personally have to play around with php and the idea of Jumi that when you want to you can.Roops wrote:Hi everybody,
I m stuck'd with editing PHP code in article.
You might find it easier to use Sourcerer (google for Joomla sourcerer). There is an accompanying plugin that will add an 'Add Code' button to your editor, which opens a sourcerer editor so you can just paste your code. Best to use the button and their editor otherwise your own editor might stick undesirable html tags into the code.
Good luck.