The Blank Module is a Joomla extension that let you put in a frontpage module everything you want:
- HTML code
- CSS code
- PHP code
You can also be able to set the ID,class and style attributes for that module.
It's very easy to use, just put tha code in the text areas and you will be able to do whatever you want to do:
- Show advertise code, like Google Adsense
- Google custom search box
- Statistics code, like StatCounter or Google Analitics
- Paypal or Donation box
- Facebook social plugins
If you are an advanced user you can also use PHP code to create a module more functional to the website.
A few examples about how to use this blank module in your website:
- How to add the Google translator widget to a Joomla website
- How to add Google Custom Search to Joomla website
If you are a developper maybe you could be interested to put some PHP code, but if you don't know how is better to read the follow sample instructions.
The first thing is to test if the module is working properly. To do it you can just put this code in the PHP textarea and enable the PHP code with the check box:
echo "Hello world!";
Then if it's working you can try with something more usefull like retrieve one article.
First you need to connect to the joomla database:
After you can set the database query to retrieve what you want, in this case you need access to the "content" table, then the table name will be "#__"+"content" and finally you must specify the ID of the article that you want, that now is number 4:
$db->setQuery('SELECT * FROM `#__content` WHERE `id`= 4 ORDER BY `id`');
Now you can load the results of the query in a array and use it:
$contents = $db->loadObjectList();
echo "title is: ".$contents->title."<br/>";
echo "intro text is: ".$contents->introtext."<br/>";
echo "article text is: ".$contents->fulltext."<br/>";
In this way you can access to every contents and to every parts of the content, and after you can choose how to show it.
So you can create a news module or a users module, whatever you want! Personally I don't use anymore modules done by others developper, because with this blank module I can do everything by myself.
If you want to have more information please check the Joomla documentation.