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.

4 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.

      1. Except that using Sorcerer to add PHP into an article, requires the pro version that costs 30 Euros. Completely and utterly lame. It looks like Joomla is a very poorly written system, that is based on a con-artist freemium model.

        It feels like a scam. Here’s Joomla’s strategy:
        1) Write terrible code, and provide rubbish functionality out of the box.
        2) Make fixing the problems that occur straight out of the box, very complicated.
        3) Get your developer friends to create plugins that cost money to solve these small problems.

        Overall if you pay tens of dollars / Euros to fix every little issue, then things become extortionate. My experience with Joomla so far is that it is utter rubbish. It defaults to putting IDs into URLs! This is awful for SEO, and just looks plain rubbish. Who on earth implemented that out of the box!? Utterly useless. The fixes online involve hacking the code… unfortunately these hacks don’t work, they leave me with 404s. Again, utterly useless. Even if these hacks do work, an update apparently wipes the hacks, so you need to redo the hacks EVERY time an update happens. Wow oh wow oh wow. How come people even use this junk?

        1. Thanks mike for your valuable opinions.

          In my experience Joomla is well structured and much matured compare to similar cms available on the market. The only thing with Joomla is causing problem is ,right problem solving method, So many extensions available on the market with different solutions.
          For this example the plugin that you mentioned is good for non-coders but I always prefer Method 3 from my article that is best suit options.

          I had experiences with WordPress, Drupal and few other common platform available on PHP
          But when we compare CMS like WordPress with Joomla , Joomla is far better.
          You mentioned SEO issues with ID’s in URL’s that can be perfectly solved with Joomla router class implementation. but most of the extensions that available on the market they don’t take care of this kind of issues

          Regarding hacking issue , none of the Software or website is 100% secure, but when we compare Joomla with .other cms its far better (especially WordPress).
          The website security is not only relay on the web app tech , it relay on web servers and configurations too. so week passwords or wrong server config may lead to a hack.

          Yes Joomla is bit developer friendly than users , but in fact the code pattern and framework structure is very good.

          In my style of working what I do is, choose the platform based on project requirement. do not relay on a single stuff !

          I’m good at Joomla but I built my blog with WordPress ! why bcoz WP is far better for this purpose when we compare Joomla.(of course Joomla have EasyBlog but its paid)

          If you had a CMS sites with multi-language you should consider Joomla/Drupal do not think WordPress for it.

          If you’re planning for a shopping cart think about prestashop/Majento

          If you’re thinking about fully customized build , the amazing Laravel framework is available . So think about platform according to projects.

          Thank you.

Leave a Reply

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

 

FacebookTwitterGoogle+RSS