Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add custom PHP in Joomla?

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?

like image 561
Bimba Shrestha Avatar asked Apr 30 '13 01:04

Bimba Shrestha


People also ask

How do I add a custom PHP code to my WordPress site?

To start, install the Insert PHP Code Snippet plugin, then click activate. Then, navigate to the PHP Code Snippets section under the plugin's menu. Click “Add New PHP Code Snippet”. Here, you can make your snippet.


2 Answers

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}
like image 110
Lodder Avatar answered Oct 19 '22 03:10

Lodder


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.

like image 45
Tom Avatar answered Oct 19 '22 03:10

Tom