Joomla php within sourcerer not displayed

孤人 提交于 2019-12-13 04:53:46

问题


I have successfully installed sourcerer, but the following code in a module doesnt show the expected result (only TEST1 and TESt2 get displayed). What am I missing?

<p>TEST1 
{source} 
<!--?php echo "My first php snippet";
?--> 
{/source} 
TEST2
</p>

回答1:


If the article mentioned here is right you need to change

 <?php echo "My first php snippet";?>

to

 [[?php echo "My first php snippet";?]]

to avoid it being produced as a comment in html

https://www.nonumber.nl/extensions/sourcerer#code-is-stripped-when-i-save-the-article

Maybe the double brackets syntax mentioned in the article is what you need.

If you are just starting out this little "manual" looks handy https://www.nonumber.nl/extensions/sourcerer#php-is-not-working

It also appears that there are options you need to set to allow php among other types of script such as javascript or css: https://www.gavick.com/documentation/joomla/disable-html-filters and https://www.gavick.com/documentation/joomla/templates/customization/custom-javascript-css-php-code



来源:https://stackoverflow.com/questions/34363297/joomla-php-within-sourcerer-not-displayed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!