I'm having a very difficult time putting custom code into my first Joomla website. Is Joomla seriously limited to only the extensions and modules that they already provide? How can I customize it with my own PHP code?
4 Answers
Is joomla seriously limited to only the extensions and modules that they already provide.
Absolutely not. Joomla is quite rich when it comes to customization. All those extensions and modules is something that people have created using the rich interfaces available.
The wealth of information is here.
In terms of customization there are 3 main things to look at:
Plugins - event driven and fairly easy to do
Modules - where you put small capabilities across your website; very easy to do
Components - definitely the most complex (don't start with this) but this will create the main functional unit. I use this for more complex applications
Your php experience will be put to good use.

- 2,604
- 11
- 57
- 96
I've needed to do this multiple times with Joomla, so I always go for Sourcerer. It's a free Plugin that allows you to add custom code, such as CSS, Javascript and PHP to articles. Below is an example of how easy it is to be done:
{source}
<?php
echo '<p>';
echo 'Hello';
echo '</p>';
?>
{/source}

- 19,758
- 10
- 59
- 100
-
Whew. Thank you. I really did not want to have to make a custom component. Joomla should really have this built in – Bimba Shrestha Apr 30 '13 at 13:15
turn off the editor first -> goto module manager -> add customHTML module -> paste your code (php, html, javascript, css etc) and save... nastiest and quickest way of doing what you want.
editor off because otherwise it'll clean up your code...
after that, try to create your own module/plugin to suit your needs (see links above @Tom), then make a lite and pro version and make money... all it needs is a good idea xD

- 84
- 4
-
Thanks. If this way is the "nastiest" way, then what is the cleaner way. To make my program the correct way, will i have to end up making a full scale component? – Bimba Shrestha May 01 '13 at 03:24
-
it depends on what you want to achive. is it a little thing like: colorbox for all images, then you would do a plugin, if it is something e.g. like a FBfanbox or videos via api calls then a module would suit your needs already, anything bigger involves building an own component, e.g. would be a custom content managing component (k2, tz_portfolio, swmenu, anything that needs more than just a few line of code ^^ you can check out `Joomla! Programming` a really nice book to give you a good start with customizing Joomla, you'll see thats its fairly easy if you already know PHP like your pockets ;) – Django May 01 '13 at 15:57
-
Doesn't work for me. I can insert custom html, but php code is ignored (it's visible in editor after save, but does not execute). – Jarekczek Mar 26 '16 at 07:32
Based from my experience, Joomla is very powerful and everything that we want was provided because there are a lot of components and modules on the internet. Sometimes I edit the component or the module that I downloaded. Just go to the folder and you will see the codes from there you can edit it. Or you can create your own module or component based on the needs of your client

- 117
- 4
- 15