I installed TinyMCE and it changed everything to Filtered HTML instead of Full HTML. How do I change everything back to Full HTML?

Comments

alan d.’s picture

This is not the core filter system, (I'm assumming your filters all point to Full HTML still), as TinyMCE also filters a number of tags.

You can easily modify these by adding the tags you want directly to the TinyMCE $init via the theme hook, "theme_tinymce_theme".

My D5 code has an example that is commented out. Simply uncomment and add the tags you need.

To use a hook, define this function in your template.php file:

<?php

function phptemplate_tinymce_theme($init, $textarea_name, $theme_name, $is_running) {
  // saves redoing everything
  $init = theme_tinymce_theme($init, $textarea_name, $theme_name, $is_running);
  if (isset($init)) {
    $init['extended_valid_elements'] = array('a[href|target|name|title|onclick]');
  }
 return $init;
}
?>

Alan Davison
www.caignwebs.com.au

Alan Davison
HollywoodChicago.com’s picture

Thank you, but actually I'm just asking where in the Drupal admin to modify what all the nodes are displaying in by default. I want to change that back to Full HTML. TinyMCE for some changed it and I don't remember how to change it back.

Road Runner’s picture

Check under Site Configuration>Input formats

HollywoodChicago.com’s picture

That lets me edit the input formats, but not specify which node they apply to. That's what I'm trying to find...

alan d.’s picture

If you are not using the primary login, admin/uid 1, check that you have rights to administrate input filters.

Next go to the filters configuration page, and make sure that at least one of your roles are allowed to use both filters.

Note: I am assuming that you still have both "Filtered" and "Full" html filters. If not recreate one if you need both.

Check both filters, eg: configure them to have the correct filters applied to each input format.

Finally, (sorry if the above wasn't needed - you never know on an unknown system), go to each node and switch the format options under the body field to use the correct format. This is a drag, so if you grab the id, you can update the DB directly, by switching the filter id.

Hope this helps


Alan Davison
www.caignwebs.com.au

Alan Davison
HollywoodChicago.com’s picture

All the permissions and everything else is fine. You say:

Go to each node and switch the format options under the body field to use the correct format.

I think that's what I need. How exactly do you do that?

alan d.’s picture

First, I'm assuming a default install, but you never know:

Run this

SELECT format, name FROM filter_formats;

This will return the defined formats

EG: The default is:

1, Filtered HTML
2, PHP code
3, Full HTML

So the format you want here would be 3

Next check your node_revision table

SELECT format, title, nid, vid FROM node_revisions;

This should show you the formats of all your nodes. Then either manually update them individually, select the format under the body section while logged in as a user that can select input formats.

If your results do not match mine, there is probably another issue, if the same...

This changes your database, so backup first.

This updates all filtered HTML to full HTML

UPDATE node_revisions SET format = '3' WHERE format = 1; 

This could cause tables to suddenly appear, (eg: they were being formated out before), and can really mess with the site, thus the backup being REQUIRED. A test server could be in order.


Alan Davison
www.caignwebs.com.au

Alan Davison
mattgilbert’s picture

does this work on all text fields, or just the body? is there a way to switch all text fields?

linuxpimp’s picture

So far i've only found this for the "body". I also need this for cck fields...

Ideas?

L

alan d.’s picture

The format value could be stored in another db table, in the variables table or inside a serialized field!

For a non-shared 1 to 1 CCK field resolution on the content type job, I get the following table:

CREATE TABLE `content_type_job` (
  `vid` int(10) unsigned NOT NULL default '0',
  `nid` int(10) unsigned NOT NULL default '0',
  `field_resolution_value` longtext,
  `field_resolution_format` int(10) unsigned default NULL,
  PRIMARY KEY  (`vid`),
  KEY `nid` (`nid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

The column field_resolution_format holds the format value.

If the field is a 1 to many relationship, look for a table called "content_field_FIELDNAME" and a similar column.

Since you need to ask this question, I must restress this point - BACKUP FIRST before playing with the database

Good luck with the search


Alan Davison