Static Joomla variables

I recently found myself searching for static Joomla variables to use in my component development.

Here are a couple of interesting ones (I will update this list as I find more):

  • JPATH_COMPONENT_SITE – points to the site folder of your component for example /home/user/website/joomlainstall/components/com_yourcomponent
  • JPATH_COMPONENT_ADMIN – points to the admin folder of your component for example: /home/user/website/joomlainstall/administrator/components/com_yourcomponent

 

Using the PHP Form Builder Class (PFBC) within your own Joomla Component.

I was in the need of professional forms for a Joomla component I’m currently writing.
With “professional” I mean the forms have to look professional and also need to be validated in a professional maner.

I first went through a lot of Javascript/CSS solutions where in the back of my mind I thought I still have to validate all input on the Server level (Within the Joomla component itself)

Finally I found an actively maintained Forms Library that after some testing I found works great within any Joomla Component.

Here are some basic notes on how I accomplished this:

I’m using a file called loader.php located in the library path in my component Directory.
I call it from my main controller file like this:

require_once(JPATH_ROOT.DS.'components'.DS.'com_component'.DS.'library'.DS.'loader.php');

in my loader PHP I have this line:

JLoader::register('Form', JPATH_COMPONENT.'/3rdparty/PFBC/Form.php');

As you can see I just copied the PFBC folder into a folder called 3rdparty within my Joomla component folder.

Now you can use PFBC anywhere in your component by creating the object like this and add a field for example:

$form = new Form("testing", 300) ;
$form->addElement(new Element_Textbox("My Textbox:", "MyTextbox"));
$form->addElement(new Element_Button);

Assign it to the View as usual:

$this->assignRef('myform', $form);

And render it in the tmpl file:

echo $this->myform->render();

The result looks like this:

Joomla-and-PFBC Screenshot

How to install Joomla at HelpingHost.com

Today we will show a short tutorial on how easy it is to get started with Joomla at HelpingHost.com.

First as usual you login to your Hosting account

 

 

Once logged in look for our Softaculous Icon and click on it.

 

Next, click the little blue Icon next to the domain you are working on:

You now are presented with the Softaculous auto installer. On the left side in under the category Portals/CMS you will find two Joomla links.
Currently while I’m writing these instructions there will be Joomla 1.5 and Joomla 1.7 as options. For this example, click on the Joomla 1.7 link:
On the Joomla install page that appears, click on the small install link.

In this last step of the Joomla installation, most fields are self explanatory.

 

 

 

 

 

 

This one you should pay attention to:
“In Directory”

which is the folder name into which you want to install your Joomla.

IMPORTANT: This field should be EMPTY if you want to install Joomla into the root of your website which effectively makes the Joomla install your homepage.

Two fields that you should just ignore are “Database Name” and “Table Prefix”

Table Prefix Setting

Database Name Setting

Last, click the INSTALL Button. A short time later your Joomla install is ready for you to use.

How to call a custom html module within a Joomla component.

Today I needed to render a Custom HTML module within a Joomla Component I’m currently writing.
After some research and testing this seems to be working great for me:
   $mod = &JModuleHelper::getModule(‘custom’, ‘Custom HTML’);
echo JModuleHelper::renderModule($mod);

I have this piece of code in my default.php file within my views/default/tmpl/ folder.
The ‘custom’ refers to the module mod_custom and ‘Custom HTML’ specifies which of the mod_custom modules to call.

Lets say you have a Custom HTML module with the title MODULEA and one with the title MODULEB then you can call and render them this way:
    $mod = &JModuleHelper::getModule(‘custom’, ‘MODULEA’);

    echo JModuleHelper::renderModule($mod);

    $mod = &JModuleHelper::getModule(‘custom’, ‘MODULEB’);
    echo JModuleHelper::renderModule($mod);
A couple of important notes:
  • At the time of writing I’m using Joomla 1.7
  • The modules HAS to be published.
  • It needs to be assigned to the pages/menus you want it to display.