Joomla include js using jumi

1.9k Views Asked by At

I can't manage to include a javascript in an article(directly in the wysiwyg editor) using jumi.

What I've tried:

{jumi /path/to/file.js}
{jumi [/path/to/file.js]}
{jumi /path/to/file.js}{/jumi}
{jumi [/path/to/file.js]}{/jumi}

"file.js" is located in a folder in the same directory as Joomla.

I'm using joomla v. 1.7.3 and Jumi 2.0.6.

Is there something I'm missing?

2

There are 2 best solutions below

0
On BEST ANSWER

I've found a workaround, it's not elegant, but it works:

create two files, 1 php which will echo a script element and a javascript file that you wish to include

in the article put:

{jumi [path/to/a/php/file.php]}

the php file should be

<?php
  echo "<script type=\"text/javascript\" language=\"javascript\" src=\"path/to/js/file.js\"></script>"
?>

Enjoy!

1
On

I'm not sure if this solution is much different than yours, but you can got to the Jumi Application Manager and create a new entry like this:

<?php
  $document =& JFactory::getDocument();
  $document->addStyleSheet('path/file.css');
  $document->addScript('path/file.js');
?>

Then add this to your article:

{jumi[*5]}

Where "5" is the id of the Jumi entry.

At least this is how I do it in Joomla 1.5...