Categories
CMS Development Joomla

using the sourcerer plugin the code written in php disappears

I try to hide a menu item programmatically, I found this publication that explains the process as follows

  1. Create custom html module
  2. Install and enable the Sourcerer plugin
  3. In the module editor use a code similar to this

enter image description here

I have done the steps, but I have not achieved the code written in php to be executed, in fact when trying a simple {source} <?php echo 'test'; ?> {/ source} or {source}[[php echo 'test'; ?]]{/ ​​source} the code is not executed, nor is it shown as a comment. It just disappears. If I disable Sourcerer the code is shown as text. I tested the same code in a new instance of joomla and it works properly. Going back to the joomla instance of the project where I work, I verify that the Sourcerer plugin is enabled, verify that the configuration of executing html, css, js and php code is enabled. I have tested with different editors. Unfortunately the same result.

As a final comment I can verify that using Sourcerer, the code written in html and javascript is executed properly. In fact, I temporarily hide the menu using an ajax call to a complement controller method. This works, but for a moment the menu item is displayed and I want to avoid this and do it with php

I will appreciate your help

Leave a Reply

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