Home Articles Development

J!DUMP An invaluable tool

   
March 07, 2010 by Victor    

J!Dump is the single best extension you need to make your Joomla coding experience more fun. Instead of using print_r() or var_dump(), you can now use dump() to see what's inside a variable, an array or object. This will open a popup window with a nice expandable DHTML tree, showing the contents of the variable. It will even show the list of the available methods of each object. You can use dump() in your extensions, in the core, in libraries or even in templates.

SQL SELECT examples

   
January 30, 2010 by Victor    

I think SQL and CSS have something in common, on the first look they appear to be dead easy to learn and then, as you move on, you realize that things can get tough. This is because both CSS and SQL trying to resemble ordinary language, they remain syntactically loose. This is good and bad. You can get to the same result by following different paths, the compiler will not be extremely strict with you but, when you try to build something, you may stare at you monitor for a really long time before you start writing a single word.

Now, as long as Joomla stores all its data in a MySQL database, you definitely need a fundamental knowledge of SQL to get to the next level. SQL is useful for looking behind the scenes, for generating reports or for changing data on the fly. Not to say that it is vital if you look forward to creating your own Joomla extensions. In this article I will give you some basic SQL SELECT examples attempting to build difficulty gradually. All examples should work if run against a standard Joomla database so, go ahead and test them.

Content plugins: Quick examples

   
June 28, 2009 by Victor    

Writing a Joomla plugin is a fairly straight forward process. In particular, after reading this article at the Joomla developer community I tried creating a few quick plugin examples of type "content" just to verify their operation. The plugin templates provided in the article are very simple and the whole process is really easy to follow. The motivation behind the attempt was to create smart article headers and footers as well as to embed custom tags in my articles that would be replaced upon display.

Joomla plugins cover various areas like user authentication, content display, content editors, web services and others. For a quick introduction on the various plugin types you can also read this article.

The high level picture behind plugins is this: Joomla incorporates a global dispatcher object that triggers events. Plugins are basically listeners that attach to these events. From our point of view, we just need to declare a class that inherits from the JPlugin class and define methods that will be executed upon event triggering automatically. The good news is the implementation of the dispatcher and the whole event triggering mechanism is (thanks Joomla) hidden to us... It boils down to defining a method, synonym to the triggering event.