
In this series of post I will outline some common techniques to help Joomla extensions development.
As you know Joomla is shipped with Mootools library which assign $ also to Ajax. Here is 2 tips that will allow you to use jQuery scripts without any modifications (most of the time you will find tips to assign jQuery to something else than $ and rewrite your scripts)
First it is recommended to include always mootools first to avoid jQuery conflict issues
JHTML::_('behavior.mootools');
$document = JFactory::getDocument();
$document->addScript(JURI::root() . "media/com_cedtag/js/jquery.1.7.2.min.js");
then to run jQuery in noConflict mode. Note that here I do not assign jQuery to any alias.
$document->addScriptDeclaration("jQuery.noConflict();");
Till here, this is what you will find on all Joomla forums, posts over the internet. The last tips is what make the difference!
Instead of using a different alias for the jQuery object (when using noConflict), you can write your jQuery code by wrapping it all in a closure. This can be done in the document.ready function
$script = "jQuery(function($) {
$();
});";
$document->addScriptDeclaration($script);
This way you are not force to rewrite your scripts to use another alias (replacing $ with jquery alias for example in all your scripts). This make inclusion of jQuery really easy!
Happy Coding!
Category: Joomla
Created on Monday, 21 May 2012 11:31
Last Updated on Monday, 21 May 2012 11:31
Published Date
Hits: 97

CedTag has been updated to version 2.5.3 and correct a lot of bugs and contains some nice features.
CedTag is the continuation of the GPL component Joomla Tags (www.joomlatags.org), Most of the codehas been rewritten according to the new standard of Joomla 2.5, the component has been greatly extended and most bugs have been removed. I will continue removing, refactoring existing codebase, in order to be able to add new features faster.
What’s new
NEW: Auto completion of tags in frontend and backend using jQuery. You can add new tags, search and remove tags without fearing creating duplicates!
NEW: Joomla ACL support,
NEW: Add basic support for themes, still need some css correction for optimal results
NEW: Use confirmation popup windows for all delete/clear operations,
NEW: New option to switch off tags title in front page,
NEW: No white background in simple.css for people loving their black background as default,
NEW: cedTag is now having no warnings/errors in PHP error level E_STRICT
BUG: I cant disable cedTag on front page when i disable it any thing not change...i want show tags only on full article view...
BUG: Working update manager: starting at version 2.5.3 you can update with one click in the update manager.
BUG: Did remove a hack of me for testing -> it was not possible to switch off the add tags button in frontend since i fixcoded to true :-(
BUG: Correct issue in editor xtd plugin blocking users to edit/view articles in frontend
Code cleaning
- Rewrite 90% of all query string to use the $query object api of joomla
- Did clean the content plugin a lot,
CedTag is used on this site with more than 5000 tags in 2200 articles.
Your ideas are important, feel free to contact me and ask for new features!



Category: Joomla
Created on Monday, 21 May 2012 08:20
Last Updated on Monday, 21 May 2012 08:20
Published Date
Hits: 62