Understanding Input Formats
From time to time people will ask me questions about problems they are having with content not displaying properly in nodes. Site developers may have problems displaying images, javascript, flash and php code. The problem is usually related to the input format chosen when publishing the node. The following video provides a very detailed look at how input formats work within Drupal.
Input Format Basics
There are three "out of the box" input formats for Drupal. These formats can be found on your site at admin/settings/filters.
- Filtered HTML - This format allows very basic text input and some HTML. This is a good format for comments and user generated content since it limits the ability of the user to add malicious code to the node.
- Full HTML - This format allows the full range of HTML tags including <embed> codes that are typically used for inserting widgets or embedded videos. This is my preferred format as a site administrator for creating all nodes and blocks on my sites. You can open this up to site users but it's recommended only for logged in users that have accounts at your site.
- PHP Code - This format allows the posting of PHP code. This is used to customize the nodes on your site. There is a gallery of PHP snippets on Drupal.org where you can find examples thay may help extend the features of your site. This is a format that should only be available to admin users of the site. Opening up the PHP format to users jeopardizes the security of the site. So take great care when using this format.
The input formats in Drupal are highly customizable so you're not stuck with the exact formats that come standard with Drupal. Since these input formats greatly effect how and what content is posted to your site it is definitely a worthwhile investment of time to get to know them better.
- learnbythedrop's blog
- 2425 reads




Comments
I've recently found the Better Formats module and have started using it on this site. So far it works well and I like the ability to adjust input formats based on the user role and node type. I also the ability to hide the formatting tips that typically appear below the comment entry field.
Wow this post has been quite helpfull thank you!.
Post new comment