1

After a minimal install (v7.22) I've only got the 'plain text' input format and am missing the 'filtered HTML' and 'full HTML' formats. Is there a way to have just the missing formats installed or do I need to manually add them? If I have to manually fill in the details where can I get the information them as after searching I cannot find any details on this.

4

If you want to set them up exactly as they were in the default installation profile, you can just copy the code from /profiles/standard/standard.install and run it somewhere (e.g. at /devel/php with the Devel module installed):

// Add text formats.
$filtered_html_format = array(
  'format' => 'filtered_html',
  'name' => 'Filtered HTML',
  'weight' => 0,
  'filters' => array(
    // URL filter.
    'filter_url' => array(
      'weight' => 0,
      'status' => 1,
    ),
    // HTML filter.
    'filter_html' => array(
      'weight' => 1,
      'status' => 1,
    ),
    // Line break filter.
    'filter_autop' => array(
      'weight' => 2,
      'status' => 1,
    ),
    // HTML corrector filter.
    'filter_htmlcorrector' => array(
      'weight' => 10,
      'status' => 1,
    ),
  ),
);
$filtered_html_format = (object) $filtered_html_format;
filter_format_save($filtered_html_format);

$full_html_format = array(
  'format' => 'full_html',
  'name' => 'Full HTML',
  'weight' => 1,
  'filters' => array(
    // URL filter.
    'filter_url' => array(
      'weight' => 0,
      'status' => 1,
    ),
    // Line break filter.
    'filter_autop' => array(
      'weight' => 1,
      'status' => 1,
    ),
    // HTML corrector filter.
    'filter_htmlcorrector' => array(
      'weight' => 10,
      'status' => 1,
    ),
  ),
);
$full_html_format = (object) $full_html_format;
filter_format_save($full_html_format);

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.