10 things you are doing wrong in Joomla

606 views
456 views

Published on

A list of 10 common mistakes made by Joomla developers.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
606
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
5
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • Add/edit/delete/trash articles
    Common category manager
    Menu containers & menu types & menu options
    Templates
    Modules & module config options, template positions
    Assigning template to menus
    Plugins – built-in types & configuration
  • 10 things you are doing wrong in Joomla

    1. 1. 10 things you are doing Wrong in joomla Ashwin date | @coolbung 2nd august 2014
    2. 2. 1. file paths require_once JPATH_SITE.DS.'components'.DS.'com_community'.DS.'helper.php' Looks ugly. It needn't. You can use this without worrying about Linux/Windows/mac compatibility require_once JPATH_SITE.'/components/com_community/helper.php' This is perfectly fine and much readable. Also easier to write
    3. 3. 2. Closing php files <?php $my = Jfactory::getUser(); ?> Avoid adding a closing php tags at the end of the file. You can corrupt json output or other headers <?php $my = Jfactory::getUser(); ?> <? $db = Jfactory::getDBO(); // no closing PHP tag
    4. 4. 3. testing without debug & sef Otherwise you might have nightmare when you turn these on! ● No warnings/notices ● No database query issues ● Custom components work with sef urls
    5. 5. 4. hacking core files Obvious.. duh ? Override! I know it's obvious but sometimes the temptation to hack is just too much and needs to be avoided.
    6. 6. 5. directly using get / post Use jinput. Period. <?php $input = JFactory::getApplication()­>input; $option = $input­>get('option');
    7. 7. 6. directly editing language overrides there's an overrides manager for that in the joomla admin!
    8. 8. 7. not adding cache, suffix and other module params They're there for a reason! Cache - suffix – bootstrap size – alternate layout and there's a few more
    9. 9. 8. multiple jquery 8. multiple jquery I hope this was clear enough ? 8. multiple jquery
    10. 10. 9. Writing sql queries directly $query = “SELECT id, name FROM #__users”; If ($username) { $query .= ' username='.$db­>Quote($username); This is how dummies do it - Smart kids do it smart - $query = $db­>query(); $query­>select('id,name'); $query­>from('#__users'); If ($username) { $query­>where('username='.$db­>Quote($username));
    11. 11. 10. large js & css ● Write efficient javascript ● Use a single minified, compressed js ● Write efficient css ● Use a single minified, compressed css ● Use smaller components of 3rd party js plugins
    12. 12. 11. your favourites ?
    13. 13. Thank you! Questions ?

    ×