Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
10 things you are doing
Wrong in joomla
Ashwin date | @coolbung
2nd
august 2014
1. file paths
require_once JPATH_SITE.DS.'components'.DS.'com_community'.DS.'helper.php'
Looks ugly. It needn't. You can u...
2. Closing php files
<?php
$my = Jfactory::getUser();
?>
Avoid adding a closing php tags at the end of the file. You can
c...
3. testing without debug & sef
Otherwise you might have nightmare when you
turn these on!
●
No warnings/notices
●
No datab...
4. hacking core files
Obvious.. duh ? Override!
I know it's obvious but sometimes the temptation
to hack is just too much ...
5. directly using get / post
Use jinput. Period.
<?php
$input = JFactory::getApplication()­>input;
$option = $input­>get('...
6. directly editing language
overrides
there's an overrides manager for that in the
joomla admin!
7. not adding cache, suffix and other
module params
They're there for a reason!
Cache - suffix – bootstrap size – alternat...
8. multiple jquery
8. multiple jquery
I hope this was clear enough ?
8. multiple jquery
9. Writing sql queries directly
$query = “SELECT id, name FROM #__users”;
If ($username) {
$query .= ' username='.$db­>Quo...
10. large js & css
●
Write efficient javascript
●
Use a single minified, compressed js
●
Write efficient css
●
Use a singl...
11. your favourites ?
Thank you!
Questions ?
Upcoming SlideShare
Loading in …5
×

10 things you are doing wrong in Joomla

736 views

Published on

A list of 10 common mistakes made by Joomla developers.

Published in: Technology
  • Be the first to comment

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 ?

×