2

I imported node and comment body fields as "Full HTML" (they are coming from a trusted site).

Now I want to display those body fields differently, for example strip certain HTML tags. Do I just change the filters for "Full HTML" and use "Full HTML" as my "custom" input format? I could change the name of it, just want to make sure it have special significance in Drupal.

Or do I have to manually change them in the DB

6
  • If a user doesn't have permission to edit a specific input format like Full HTML or PHP Code or whatever, they will therefore not have access to edit a node that uses that format. Feb 18, 2012 at 20:41
  • 1
    To answer your first question, yea, just change the settings for your "Full HTML" filter. Nothing else magical needs to be done. Feb 18, 2012 at 20:42
  • If you want to massively change your nodes' input format, you can use drupal.org/project/views_bulk_operations to affect all nodes with a single UI action.
    – Countzero
    Feb 20, 2012 at 8:06
  • 2
    seems like I can still edit the node, just not that field. It shows a message "This field has been disabled because you do not have sufficient permissions to edit it."
    – uwe
    Feb 20, 2012 at 17:07
  • How did you import the content? with a script that uses node_save() or are you using a particular module?
    – blue928
    Feb 21, 2012 at 4:36

2 Answers 2

2
+50

You can safely make changes to the regular "Full HTML" filter. It has no special significance in the system. It is simply created by the "Standard" install profile because it is convenient for end users. If you install a minimal profile you won't have it at all.

Obviously changing the full html filter will affect other nodes as well that use this filter.

1

You shouldn't redo the "Full HTML" filter to actually be filtered, you should add your own filter.

Try adding your custom filter, check off all the roles that can edit the content, and then disallowing the "Full HTML" for all roles. Log in as something other than an admin role. If you resave an existing node, it should use the new filter.

3
  • thanks. Are you saying that the default "Full HTML" has a special meaning in Drupal? Couldn't I just rename it and create a new "Full HTML"?
    – uwe
    Feb 21, 2012 at 15:58
  • 1
    Full html shouldn't have a special meaning to drupal no, unless some contrib module reference the full html format by id for some obscure reason. You can rename the filter and add a new full html filter, but all existing content using this filter will be affected by this change, not just your imported nodes. So the safe approach would be to add a new filter. Whether I would choose one over the other would depend on it being on a live setup or not. My point was only that altering the existing filter wasn't the only alternative.
    – dysrama
    Feb 21, 2012 at 19:47
  • But if you have to do this to a large number of nodes, then your method requires manually changing them all. I'm guessing that he needs to change a lot of nodes (since I'm not sure why he would ask the question otherwise, and since he referred to a method of changing en masse in the database, and since he said he imported the nodes).
    – iconoclast
    Jan 8, 2013 at 18:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.