Posted by john.arroyo on February 13, 2009 at 12:17am
I'm using CCK (Acquia Drupal) and usually post as admin and haven't noticed this issue, but other members who are contributing blog posts (and other content via cck fields) aren't given the option to change from filtered html to unfiltered html. Basically I need to be able to allow my contributors the ability to add embed video tags, etc.
Also related to this, can you default a cck field to be only unfiltered html. I'd like to add a field on another node type that is always unfiltered html.

Comments
Input Format Roles?
Sounds like your input format "Role" settings do not include your contributors roles. These are checkboxes in the input format configs. In D5 or D6, go to Admin > Site Configuration > Input formats and click each 'configure' link. Look for the "Roles" fieldset where it says:
"Choose which roles may use this filter format. Note that roles with the "administer filters" permission can always use all the filter formats."
While you can set whether or not a CCK text field uses filtered text or not, it does not appear that you can select the default input format on a per field basis when filtered text is selected. Perhaps someone knows a module to allow this?
--
Markus Sandy
http://apperceive.com
http://ourmedia.org
Thanks that did it! A module
Thanks that did it!
A module or cck setting to define a default would be great.
--
John Arroyo | www.remixin.com | www.johnarroyo.com
John Arroyo | www.arroyolabs.com | www.johnarroyo.com
be aware that unfiltered
be aware that unfiltered HTML is an inherent security risk and should only be allowed for trusted users.
alternatives include allowing additional tags for the filtered input format (from the input format configuration screen), or using specific fields to allow certain content that requires unsafe tags (e.g. by using the emfield module to allow users to "embed" videos).
hth
indeed
(when it comes back online) see http://drupal.org/security/secure-configuration which discusses safe use of input formats.
--
Growing Venture Solutions | Drupal Dashboard | Learn more about Drupal - buy a Drupal Book
knaddison blog | Morris Animal Foundation
Raw HTML CCK Field (Drupal 6) - no filters, formats or editor
Simple Fix for Drupal 6! Just use plain text format. Then convert it back to html in a field .tpl when the node is built.
Plain Text format on a CCK field will convert the HTML tags to entity special characters (this would make is so it reads like code on the page instead of being actual html tags). It stores the string encoded using php's htmlspecialchars($text, ENT_QUOTES, 'UTF-8') inside of drupal's check_plain() function.
The cleanest simplest way to decode it, is in a field tpl file. This avoids hooks, hook order problems, looping bugs, and performance issues. This is done by adding tpl files to the base themes: hq_base, odyssey_base and odyssey_admin. Here is how drupal decodes plain text on a cck node edit form: print html_entity_decode(strip_tags($text), ENT_QUOTES); Note - html_entity_decode turns php tags into html comments when it decodes back to html. Here are sample files with the correct naming convention to give php control over the fields:
• content-field.tpl.php
• content-field-[your_field_name].tpl.php
content-field.tpl.php is a copy from the cck contrib into the theme folders, this is a contrib override to make it available in the theme, and should not be modified (unless you wanted to change all the fields in the theme). The field specific file is also a copy of the tpl, it will work once the override file is there. Then decode to html in the field tpl file:
• // print $item['view'];
• print html_entity_decode(strip_tags($item['view']), ENT_QUOTES);
Drupal Version Note:
The tpl files are slightly different in Drupal 7 and Drupal 8. But the html_entity_decode() is a php function that won't change per Drupal version.
Security Note:
This decode trick for getting raw HTML goes against the way Drupal was built for text formatting security. It means that anyone with permissions to edit the page now has permissions to edit html structure, and add script tags on the page. This can break layouts, and potentially be dangerous. You are relying on editing permissions for security here, instead of Drupal's normal Formats-per-Role security.