Hi,

I need help for working with input formats, as I spent severals days to find a way to solve an issue without success...

When creating new content, I want authenticated users to exclusively use the 'Filtered HTML' input format to enter some text.
So I configured the input formats to allow authenticated users to use only 'Filtered HTML', and made the 'Filtered HTML', the default input format (an admin may use other formats), so that they don't have to make a choice regarding the input format, they just write text.

When a user creates a new content including text fields, the formatting guidelines related to 'Filtered HTML' (3 text lines saying "Converts lines breaks in HTML", "Turns web and email addresses" ...) get displayed below the text field.

My problem is that I don't want any fomatting guidelines to be displayed because it makes the web page completely unread-able (I have many fields in the form), and the user doesn't need to know about these guidelines. Up to now, I could not find a way to hide these formatting guidelines! :(

I already tried the following but could not solve this problem:
1) I though that the 'Display HTML help' option of the 'Filtered HTML' filter was made for this purpose. If it is, deactivating it does not work: the tips still appear (note that to be able to deactivate this option, I had to install this patch http://drupal.org/node/208700#comment-701096 to work-around and issue in this menu). Either this option does not work, or its purpose is not to hide the formatting tips.
2) I need the 'Filtered HTML' or at least an input format with 'line break converter' and 'URL filter' filters to be able to display properly the text fields (with line breaks and nice email and web addresses), so I cannot set-up my text field property to take text as 'plain-text', I really need to specify the use of a filter (otherwise, with 'plain text' specified, no more formatting guidelines).

=> Do you know if it is possible to hide these formatting guidelines? And if yes how? Is there a bug with the 'Display HTML help'?
Or maybe you know another way to make what I want to?

Thanks for you help,
Seb

Comments

lhtown’s picture

I haven't done this, but it seems that the simplest thing if you are using the locale module would be to just search for the text string and change it something shorter or delete it altogether.

Another option would be to create a new input filter and give it the properties you want it to have. I think that would get rid of the offending text.

Also, there may be a way to edit the description of the filtered input filter, but you may either have to find the code or use the locale module to do it.

If that fails, you are looking at doing something fancy with your theme like editing php code or using using css with the offending text selected and setting it to no display.

Sebo’s picture

Thank you for your fast answer.

I haven't done this, but it seems that the simplest thing if you are using the locale module would be to just search for the text string and change it something shorter or delete it altogether.

Ok, thanks for the information. I am not using the locale module today.

Another option would be to create a new input filter and give it the properties you want it to have. I think that would get rid of the offending text.

I had already tried this one, but even with a new input format, I could not find any mean to hide the tips.

Also, there may be a way to edit the description of the filtered input filter, but you may either have to find the code or use the locale module to do it.

I explorated this way, and could get the tips hidden, by adding some code in filter.module/filter_filter_tips. This function appears to handles all the filter tips.
I understand that the $delta variable indicates the type of tip (0=HTML filter, 1=php, 2=line breaks, ...), and the $long variable indicates if the tips to display are long or not (2 flavors of tips exist).
Depending on these variables, the function returns the string of the tip.
=> I added some code to test the $long variable and return nothing if long == 0.
This removes the tips display in the new content creation window, and if clicking on 'More information about formatting options', you still get the long tips version.

I also modified the function filter.module/theme_filter_tips_more_info: to return an empty string ('') instead of the link ('More information about formatting options'), so that the user has no information at all regarding filling text.

Also by re-reading the HTML input format configuration option text ('Display HTML help'): If enabled, Drupal will display some basic HTML help in the long filter tips.
=> I guess that this option shall only apply to long filter tips, while I was looking to hide the short ones.
So I guess that what I want to do cannot be done without modifying Drupal's code...

If that fails, you are looking at doing something fancy with your theme like editing php code or using using css with the offending text selected and setting it to no display.

That may be the ultimate solution to avoid modifying the filter module code (updating the theme instead), but I don't know if the small tips are assigned a dedicated ccs property (I did not dig too much into this stuff with Drupal yet). If not, it means that the filter module code will have to be modified anyway to add this property, and use ccs to no display it.

Anyway I think it would be a good improvement to be able to hide the short filter tips (by filter type or not), as it directly appears to the user and some users are just not ready to see such kind of tips.

lhtown’s picture

Sebo’s picture

It works to remove the tips. For this, I had to put a space in the replacement expression (a blank field is ignored and the string is not replaced).

=> it works well, the only difference with the previous code hack I did is that an extra eol remains with this approach.

However, I think I will keep on using this module, as it avoids modifying the filter module code.

Thanks a lot!

javi-er’s picture

hi, also here you have more info about this

http://drupal.org/node/35122#comment-746238

heather’s picture

I imagine you solved this long ago... but the CSS solution should work, at least to hide it. All the tips are located in a ul with the class "tips":

	<ul class="tips">
	...
	</ul>

So we only need to locate where in your CSS file you have the .tips class (or add one if you don't have it), and set the display to none, and it hides for you.

	.tips {
		display:none;
	}
Sborsody’s picture

Hiding the tips using CSS does two silly things (in Drupal 6).

1) The link "More information about formatting options" is still shown.
2) Clicking on the link (http://site/filter/tips) presents a page with nothing since those tips are also given the tip class and thus not displayed.

tsi’s picture

I got rid of it all using both CSS - .tips {display:none} and locale for replacing the link with a blank field.
works beautifully !

Tsachi Shlidor (@shlidor)

designerbrent’s picture

To actually remove the "More..." link you can use the following function in a custom module:

function {modulename}_filter_tips_more_info() {
  return '';
}

krisna123’s picture

Add the following to template.php in themes/YourThemeName

/*
* Override filter.module's theme_filter_tips() function to disable tips display.
*/
function YourThemeName_filter_tips($tips, $long = FALSE, $extra = '') {
  return '';
}
function YourThemeName_filter_tips_more_info () {
  return '';
}

Note :
add this code below <?php
Don't forget to change YourThemeName to your theme name
Don't forget to clear the template cache in your site Administer->Site Configuration->Performance->Clear Cached Data.
worked for drupal 6.19.