开发者

Custom build Mootools implementing in Joomla 1.5

Greetings everyone.. can someone guide me please on how to implement my custom mootools..in Joomla 1.5

i have these files below

PHP FILE

  • promocode.php

CSS (for my js)

  • sexyalertbox.css

Javascripts

  • mootools1.js
  • mootools-more.js
  • sexyalertbox.v1.js
  • sexyalertbox.packed.js
  • jquery

i managed to put the php file in one of my component in joomla which is the ignite_gallery and display it like i wanted it to be.. but the only thing i'm lacking is that my mootools is not working at all, unlike when i run it from my root file outside the Joomla.

i am using Joomla 1.5.22 and my mootools version is 1.2 and i am using the rhuk_milkyway template

the solutions i have tried already are declaring this code below in my php file

<?php 
  $document =& JFactory::getDocument();
  $document->addStyleSheet("/Joomla/media/system/css/sexyalertbox.css");
  $document->addScript("/Joomla/media/system/js/mootools1.js");
  $document->addScript("/Joomla/media/system/js/sexyalertbox.v1.js");

  /////// i cut some lines and i just point out where i used the javascript////

  if(!empty($promocode)){
  $message= "<font color='#FF0000'></br> <b>Successfully Save!</b> </font> <script type='text/javascript'>
                    window.addEvent('domready', function() {
                    Sexy = new SexyAlertBox();
                    Sexy.info('<h1>Company Inc.</h1></br></br><b>Successfully Save!<b></br>');
                  开发者_JAVA技巧  });
                    </script>";
 }
?>

i also tried putting these scripts in C:\xampp\htdocs\Joomla\templates\rhuk_milkyway\index.php

<head>
<jdoc:include type="head" />
 <script type="text/javascript" src="<?php echo $this->baseurl ? >/media/system/js/mootools1.js"> </script>
 <script type="text/javascript" src="<?php echo $this->baseurl ?>/media/system/js/sexyalertbox.v1.js"> </script>
 <link rel="stylesheet" href="<?php echo $this->baseurl ?>/media/system/css/sexyalertbox.css" type="text/css" />
</head>

Suddenly no luck.. it is still not working.. help me please..

Any suggestion or advice is highly sought.. God bless and have a nice day..


If you are adding your own version of MooTools or subsequent dependent scripts into the head of your template then you should go into the Joomla! plugins and disable (unpublish) the MooTools plugin. Joomla! 1.5x by default uses an older version of MooTools and it often has conflicts with other libraries such as jQuery or newer versions of MooTools.

The other option is to use an extension such as this one:

Disable Joomla! core mootools implementation

This will allow you to turn off the default MooTools header tag that is inserted by the Joomla! template parse. Then your site (content pages, modules, et cetera) should be able to properly leverage the custom MooTools and subsequent scripts you have inserted into the head.

Cheers

Aaron

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜