How to Enable PHP in Blocks in Drupal


PHP is a web development language that uses a series of scripts and hooks to produce effects; the Drupal CMS, along with many other content management systems, are built with PHP. If you want to extend the function of your Drupal site, you can do so by adding PHP codes within content blocks. By default, the option for enabling PHP coding is disabled; once you enable it in Drupal you can easily add PHP code to a content block.

  • Access your website's Drupal admin panel and log in to the website.

  • Click on "Modules." Scroll down until you find "PHP Filter." Check the box next to the appropriate module, then scroll down and click "Save Configuration."

  • Click on "Structure" then click "Blocks." Click "Add New Block" or click "Edit" next to the block with which you want to use PHP code.

  • Scroll down beneath the "Block Body" section. Click on "Text Input." Select "PHP Code." This allows you to use PHP in the block's body.

  • Enter your PHP code, then scroll down and click "Save Block."

Related Searches


Promoted By Zergnet


You May Also Like

  • How to Install Drupal On 1and1 Servers

    I wrote this article to help web designers and programmers interested in using the drupal open source content management platform. If you...

  • How to Update Drupal Modules

    Drupal, the content management system developed by Dries Buytaert, was originally released in 2001. It is an open source project with the...

Related Searches

Check It Out

Geek Vs Geek: Robot battles, hoverboard drag race, and more

Is DIY in your DNA? Become part of our maker community.
Submit Your Work!