I am fairly new to Joomla, and have created a custom template for a client, and am wondering, after installing the 1.6.1 Plug-in from the extensions manager (it installed correctly and I published/activated it), if I put the PHP code into the header of my custom template's PHP file?

JPluginHelper::importPlugin( 'corejoomla' );
$dispatcher =& JDispatcher::getInstance();
$dispatcher->trigger('onCallIncludeJQuery', array($params));

I am trying to enable a JS in my header that will set my CSS columns vertically to equal lengths when one is longer than the other due to more content being in one over the other.

<script>
$(function() {
var tallest = 0;
var $columnsToEqualize = $(".column");
$columnsToEqualize.each(function() {
var thisHeight = $(this).height();
if (thisHeight > tallest) {
tallest = thisHeight;
}
});
$columnsToEqualize.height(tallest);
});
</script>

--------

I thought this might be a good/quick/clean solution. I put the script into the head of both my index.html and index.php documents, but the php code only in my index.php file - is this correct? (I am also only somewhat familiar with PHP). I've used JQuery successfully many times outside of Joomla, so this is frustrating.

Thank you in advance. Our University will likely use this plug-in quite a bit if I can figure out how to call it and get scripts working - or does JQuery only work in Joomla with customzied extensions?

Thank you.
Like it on Facebook, Tweet it or share this topic on other bookmarking websites.
  • Re: Joomla JQuery 1.6.1. Plug-in Question/Problem

    by » 10 years ago


    Yes, it will work only on Joomla. The plugin code you wrote above is Joomla API code which will not work outside Joomla.

    You wrote everything ok, but you did not mentioned the values you passed to $params variable.

    $params = array('jquery','jqueryui','jqueryform','jqueryvalidate')
    JPluginHelper::importPlugin( 'corejoomla' );
    $dispatcher =& JDispatcher::getInstance();
    $dispatcher->trigger('onCallIncludeJQuery', array($params));

    The above code will include jquery, jquery ui, jquery form and jquery validate libraries.

    HTH

    Follow me on twitter: https://twitter.com/corejoomla
    If you use our extensions, please post a rating and a review at the Joomla! Extensions Directory.
    SurveysCjForum | Polls | Answers | Quizzes | Quotes | GPS Tools | Sociable


  • Re: Joomla JQuery 1.6.1. Plug-in Question/Problem

    by » 10 years ago


    The code will works inside the joomla and not in outer to joomla.try it

    Android Mobile Application Development
    http://www.cogzidel.com/services/mobile-application-development

  • Re: Joomla JQuery 1.6.1. Plug-in Question/Problem

    by » 10 years ago


    It is Joomla plugin, will not work on non-joomla site.

    Follow me on twitter: https://twitter.com/corejoomla
    If you use our extensions, please post a rating and a review at the Joomla! Extensions Directory.
    SurveysCjForum | Polls | Answers | Quizzes | Quotes | GPS Tools | Sociable


  • Re: Joomla JQuery 1.6.1. Plug-in Question/Problem

    by » 9 years ago


    I know this is an older topic..but I still cannot get my JQuery plug-in to work in our Joomla 1.7 site.

    I AM doing this in/for a Joomla web site.

    My plug-in is enabled and the plug-in code in the PHP file is as follows (in the head tag):

    <script>
    JPluginHelper::importPlugin( 'corejoomla' );
    $dispatcher =& JDispatcher::getInstance();
    $dispatcher->trigger('onCallIncludeJQuery', array($params));
    </script>

    Here is the JQuery plug-in I am trying to use:

    http://sizzlejs.com/

    (it is a pull-down CSS3 menu that works currently in a non-Joomla currently)


    Is there a problem with compatibility?

    I am linking to the JS library files in the index.php file as well:

    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript" src="quicklinks.js"></script>

    Or, should it be something like this?

    <link rel="javascript" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>jquery.js" type="text/javascript" />
    <link rel="javascript" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>quicklinks.js" type="text/javascript" />

    I am just trying to think of anything to get this working, if possible.

    Thanks in advance.

    I've attached the js files for reference, in case that may help?

  • Re: Joomla JQuery 1.6.1. Plug-in Question/Problem

    by » 9 years ago


    PS - Do I need to pass a parameter in the PHP code above, that directly references the plug-in I am using?



    $dispatcher->trigger('onCallIncludeJQuery', array($params));

  • Re: Joomla JQuery 1.6.1. Plug-in Question/Problem

    by » 9 years ago


    $params should have the required libraries to be included.

    JPluginHelper::importPlugin( 'corejoomla' );
    $dispatcher =& JDispatcher::getInstance();
    $dispatcher->trigger('onCallIncludeJQuery', array(array("jquery","jqueryui","jqueryform","jqueryvalidate")));

    Follow me on twitter: https://twitter.com/corejoomla
    If you use our extensions, please post a rating and a review at the Joomla! Extensions Directory.
    SurveysCjForum | Polls | Answers | Quizzes | Quotes | GPS Tools | Sociable


  • Re: Joomla JQuery 1.6.1. Plug-in Question/Problem

    by » 9 years ago


    Thanks Maverick. I am placing thie above code block you provided into my <head> tag in the index.php file, surrounded by <script></script> enclosures.

    I am getting a syntax code error for the 2nd line:

    $dispatcher =& JDispatcher::getInstance();

    Is the =& appropriate syntax for PHP? (not sure, haven't seen it used before)

  • Re: Joomla JQuery 1.6.1. Plug-in Question/Problem

    by » 9 years ago


    It is php code, so should be in php tags
    <?php
    JPluginHelper::importPlugin( 'corejoomla' );
    $dispatcher =& JDispatcher::getInstance();
    $dispatcher->trigger('onCallIncludeJQuery', array(array("jquery","jqueryui","jqueryform","jqueryvalidate")));
    ?>

    Follow me on twitter: https://twitter.com/corejoomla
    If you use our extensions, please post a rating and a review at the Joomla! Extensions Directory.
    SurveysCjForum | Polls | Answers | Quizzes | Quotes | GPS Tools | Sociable


You do not have permissions to reply to this topic.
Powered by CjForum