Notes and tips
Promotion of Modules

You would think that it would be very easy to promote a custom module from one environment to the next, but it is not as straight forward as it should be. But, if you know the steps it is fairly easy.  Here they are:

Read more...
 
Changing the Default Blog layout

I was very frustrated trying to change the default blog layout without creating a menu item for each blog section of my site. I even created an override, but it wasn't the layout that was the problem, it was the parameters that were being passed.

Read more...
 
SugarCRM: Setting Relate Fields

The SugarCRM Relate Field can be a little tricky if you don't understand everything that Sugar is doing under the hood to pull this off. When you create a Relate Field, it actually adds a second field that is hidden (you never get to see it on any of the Sugar Views) that holds the ID of the related field.  

Tags: SugarCRM
Read more...
 
Image slideshow

This is a very simple Javascript image slideshow that I created as a Joomla module. This will not only pull images from a folder on the server and display them one at a time, but it will fade them in and out, so it is not a herky-jerky show. This fade is done by using two img's that are positioned on top of each other so it fades one image to the other and not one image to the background, then to the next. We start with the img src's assigned and loaded. Then we will change the src to the second image url and fade to it and pause. We then change the first img to be the same as the second and fade to it. Then we change the second img src to the thrid image url and fade to it.

Read more...
 
Creating a new user in code

To create a new user in a component or other extension I have compiled the following instructions from several sources:

This example uses a Component Model Class to insert a new user:

Read more...
 
Configuration File hiding

I got a great security tip from this forum post (click here) telling how to "hide" the configuration file from potential hackers.  This will keep passwords and other data from being exposed.  Here is the technique described in the post:

  • Move configuration.php to a safe directory outside of public_html and rename it whatever you want. We use the name joomla.conf in this example.
  • The configuration.php file in the root of the webhost should only contain the following code:

<?php

require( dirname( __FILE__ ) . '/../joomla.conf' );
?>

  • Make sure this new configuration.php is not writable at all, so that it can not be overridden by com_config.
  • If you need to change configuration settings, do it manually in the relocated joomla.conf.