How to add custom PHP in Joomla?

Asked
Active3 hr before
Viewed126 times

4 Answers

custom
90%

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.,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,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:,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?

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}
88%

This process is automatic. Your browser will redirect to your requested content shortly.,Please enable Cookies and reload the page.

72%

CSS and JavaScript are both client-side technologies, so it's enough to put them into your articles or Custom Module and just put appropriate HTML tags around them. With PHP it is impossible because it needs to be executed on the server. When articles are retrieved from DB they are served as content without further post-processing (except content plug-ins).,There's nothing wrong with using 3rd party plugins whenever appropriate, not sure why you are so against this., yes ,thats true ! CSS and JS are client-side. but joomla has many steps to display data from DB !. first fetching data - 2)OnPrepareContent Event - 3)beforeRender - 4)Render -5)OnAfterRender .and the php code rendering in the step 4! i know the solution but i don't know how to implement it – David Bereihi Jul 21 '16 at 7:28 ,i wonder how to insert php code in joomla content and custom module without plugins when i change the editor from tinyMCE to none i can insert js/css code and they work perfectly but when i insert php ,the code shown commented in the page source! is there any method to solve this problem even by core hacking!

In System -> Global Configuration, try setting the Text Filter to "No Filtering" for Super Administrator or whatever group you are a member of when you administer the website.

System - > Global Configuration
65%

Advanced Custom Fields,Advanced Custom FieldsDescriptionFree vs ProDocumentationChangelogRoadmap,How to add a PHP Custom Field to Joomla! Articles, My DownloadsMy SubscriptionsReleasesDocumentationSupport

Simple message output

return 'Hello World!';
load more v

Other "custom-undefined" queries related to "How to add custom PHP in Joomla?"