Simple Pages with PHP code is filtered


I am trying to include a PHP code in Simple Pages but even the HTML filtering is disabled, the code is filtered.

The PHP code I am including is:
<?php echo link_to_items_browse("collection-test", array("collection" => 1)); ?>

The public page is only showing the last part, after the > character:
1)); ?>

If I check the HTML code I see that php code is commented:

<!--?php echo link_to_items_browse("collection-test", array("collection" =--> 1)); ?&gt;

Any idea about why the code is filtered?

The test is easy. Just uncheck the HTML Filtering in Settings->Security-> Enable HTML Filtering-> uncheck, and insert the code above in a simple page.

I am using the last versions of Omeka Classic (3.1.1) and Simple Pages (3.2.1)

You can’t write PHP code in Simple Pages, regardless of the filter setting. Or rather, any PHP code you write in there won’t be run.

Thanks John. It was working in very old versions of Omeka (1.5.x) so I guessed it should work on newer versions. I guess it was disabled at some point.

Yes, much much older versions of Simple Pages did let you directly write PHP in the box. For a whole variety of reasons that’s not been allowed since 2.0.

For something like a link you can probably just write it out directly. For other things, there are Shortcodes to allow a more limited set of dynamic things in the pages.