Skip to main content

Drupal 7 notes: unsetting formatting tips

Posted on: Monday, 29 August 2011 @ 1:22pm
Blatting about
More specifically

Following on from hiding unwanted elements in comment forms, I found this tip on one of the many threads in Drupal of people trying to hide the pesky formatting guidelines and came up with:


That gets rid of everything but the fieldset container and for the roles that can use multiple text formats, the select box (the "Text format" label can be easily removed with $form['und'][0]['format']['format']['#title'] = ''; in the comment_form_alter).

I haven't worked out a way to unset or otherwise prevent the select box from rendering without obliterating TinyMCE, so will have to continue letting display: none; on .filter-wrapper hide it for now :)

No comments yet

Anonymous Tuesday, 7 February 2012 @ 11:35am [Permalink]
'twas helpful, thanks!
bek Tuesday, 7 February 2012 @ 11:47am [Permalink]
Devender Thursday, 23 February 2012 @ 8:04pm [Permalink]
use unset($form['und'][0]['format']); if want to remove every thing like help, guidelines, and text format types etc
bek Sunday, 26 February 2012 @ 6:12pm [Permalink]
Sam Hassell Tuesday, 22 May 2012 @ 1:37pm [Permalink]
Hey Bek, Second time I've wound up on this page so I thought I'd comment.:)- Sam.
bek Tuesday, 22 May 2012 @ 2:28pm [Permalink]
pverrier Saturday, 26 May 2012 @ 1:44am [Permalink]
Thanks ! It helped me to solve a similar problem, limiting the filter formats choices :
bek Saturday, 26 May 2012 @ 2:35pm [Permalink]
fucker Monday, 27 January 2014 @ 2:57am [Permalink]
entire Internet idiots this post is just a piece of shit

Add new comment

The content of this field is kept private and will not be shown publicly.