0

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!

  • Why on earth would you be in favour of core hacking over a 3rd party extension? – Lodder Jul 21 '16 at 7:23
  • i want to customize joomla for myself - there is no force for core hacking but i want to add this plugin as a option in joomla content component – David Bereihi Jul 21 '16 at 7:44
1

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
  • The Joomla's way would be to write a plugin... The very Joomla's way would be to create "installable" modules, which you could also include inside content. 2nd way is time consuming and bad in many situation, then using 3rd party plugins is a good solution. Or you write your plugin on the "render" (not sure if it would be the right one) event, or you find this event in the core and at it's place you execute your php code. Solution: use a plugin anyway. – Adam M. Aug 20 '16 at 7:54
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.