HTML Logo by World Wide Web Consortium ( Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Login / Search

 [ Join | More ]
 Add topic 
#77265 (In Topic #15898)

Fan in training


So I tried to add a PHP code in the header, and I got this message:
The hidden allow_php_in_templates option is not turned on, so PHP code in templates will not run. The option is described in the ocPortal Code Book, available from The standard practice for your use case is to create and reference a miniblock, as it separates concerns well, promotes re-usability, and provides a security barrier.

How do I enabled allow_php_in_templates? And how do I create a miniblock? I do not have any experience with PHP and stuff, all I wanted to do is to do add a Php include.

Hope to hear from you soon!

Back to the top

Community saint

To set a hidden value to true, open up OcCLE (under the 'tools' section in the Admin Zone or clicking the symbol at the bottom-left of any page) and type :set_value('<name>','1')

So to enabled allow_php_in_templates you would type:


in the OcCLE command prompt.

Note that it is not recommended to enable allow_php_in_templates as it is a security risk as described in the Code Book as follows:
This allows you to write PHP code inside templates, but please aware there are strong risks associated with this. It means that themes you install may contain PHP code, or people submitting Comcode content may put in PHP code which you could accidentally unwittingly activate when validating content (as it
would be validated against your own security credentials).
As for miniblocks, see Creating Miniblocks from Third-Party Code - ocPortal

Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: