1

Drupal 7.24, fresh installation

I'm fairly new to Drupal and I'm trying to figure out if it's possible to create a node type that acts like a PHP page. I have a code library that needs certain files required once in a node type that displays output.

I've tried using Full HTML and also created a new text format that had all vanilla Drupal options unchecked and the PHP snippets do not function.

I'm sure I'm mixing up terms and I hope you understand what I'm going for, like I said I'm fairly new. Do I need to look for a different text format?

Thanks for your time, and Happy New Year!

2

First, you will need to enable the "PHP filter" core module in admin/modules. I think you did.

Then, you'll need to configure the newly added text format in admin/config/content/formats and assign some role to that text format. Note that you can also do this from admin/people/permissions.

Useless to say you'll need to be very conservative here and only allow this text format to - very - trusted users (roles).

Finally, in your node content, select the "PHP code" text format and type your code (including tags).

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.