Main menu
WalkswithMeJoomlaHow to include html or php codes into joomla article

How to include html or php codes into joomla article

HTML or PHP codes into Joomla article is highly recommended feature for Joomla users, due to security reason Joomla editors will not allow to include HTML or PHP codes into Joomla article.

So How to include HTML or PHP codes into Joomla article ? There are many extensions available for Joomla to achieve this requirement like sorcerer . Using extensions is pretty simple and fast to fix the task, But some time plugins or extensions have some limitation to our requirement or it may be paid. So here I will explain an alternate option for include HTML or PHP codes into Joomla article.

Method 1

Using this method an administrator user can add some complex HTML tags or remove some restrictions over the Joomla article content section. Keep in mind its not allow users to add a full PHP or JavaScript codes into Joomla article.


Login to admin -> Site Menu -> Global Config -> Text Filter (Choose no filter) // For latest version of Joomla 2.x +
Login to admin -> Article Manager -> Options -> Text Filter (Choose no filter) //For Older version like Joomla 1.6,Joomla 1.7

 

include HTML or PHP codes into Joomla article

include HTML or PHP codes into Joomla article

Method 2

If you are planning to use some custom module, for your article content to achieve HTML tags or scripts into Joomla article; then the best option is to use Joomla’s default Custom HTML module for this.


Login to admin -> Extensions Menu -> Module Manager -> Create New Module -> Choose Custom HTML .

This will allow you to add Custom HTML in your module then simply add this module position into article.


{loadposition yourmodule_position}

Please keep in mind while you are using this option like modules into Joomla article make sure Joomla’s default Content Load Plugin is enabled.

include HTML or PHP codes into Joomla article

include HTML or PHP codes into Joomla article

Method 3

This is the final option it will allow you to add Custom Complex HTML ,PHP , JavaScript , Css to the Joomla article.
The idea is simple create your own custom module and load it in the article section using above mentioned method (Content Load Plugin).

For creating Joomla module you can refer my Joomla Module Development tutorial , Also with module option you have any Email spambots error in Joomla refer my related articles.

I recommend the Method 3 for include HTML or PHP codes into Joomla article rather than using extensions because you are the creator of your module so you have all rights to extend its features and options.

Hope this article will help you to create a Joomla module that have Custom HTML or PHP codes for your Article Manager.

Two thoughts on “How to include html or php codes into joomla article

    1. The simplest way to include html or php code to article is using sorcerer .

      the other option is you have to create a custom HTML or your own module and then place your code in module’s default.php .
      Then simply use {loadposition yourmodule_position} inside your article content it will render the module output once the article rendered.
      Hope its clear.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 
FacebookTwitterGoogle+RSS