I enabled the Compse Tips but would like to customize it to fit my needs. I know i can create my own but since this page is there i might as well make it look and have what i need.

Now, the URL shows filter/tips but this does't really exist. Can anyone please tell me where to find this "Compose Tips" page?

Thanks in advance.

Comments

CompShack’s picture

Any one know how can i do this?
-----------------------------------------
Finally, I CMS that I Like!
http://www.CompShack.com

arhip’s picture

Hi,

Every filter module has its own compose tips. If you use only Drupal HTML Filter, you can find Compose Tips in modules/filter/filter.module, in the function filter_filter_tips(). But I don't recommend you to do any change on this, because the HTML is hard-coded there.

I don't know what do you mean by customizing it to fit your needs. If you mean customizing the text, I suggest you create a new node, since the compose tips text is hard-coded. Or you can try Custom Filter module to add some dummy filter (i.e. filter that doesn't have any replacement rule but have compose tips). But if you mean customizing the theme, I think no need to look at filter.module

CompShack’s picture

Thanks for your reply - I will go ahead and create a custom page. I looked at the function and better to leave it alone. Thanks again!

-----------------------------------------
Finally, I CMS that I Like!
http://www.CompShack.com

mdgrech’s picture

so you created a custom page...but how did you get the "more information about formatting options" to link to your custom page?

yakker’s picture

You can use the theme_filter_tips_more_info() function in your template.php file. Just substitute your theme name where it says "theme", and then modify the call to the l() function (that's the function that creates the link). The second parameter in the l() function is the href - point that to your custom page.

But this doesn't solve the issue where by filter_tips populates the content automatically based on your filter settings (which I'd like to keep).

For reference, you can find the documentation for the l() function here: http://api.drupal.org/api/function/l/6
And theme_filter_tips_more_info() here: http://api.drupal.org/api/function/theme_filter_tips_more_info/6

For reference, here are the functions below. All you need is theme_filter_tips_more_info() in template.php, suitably renamed, and altered to fit your needs.

<?php
function theme_filter_tips_more_info() {
  return '<p>'. l(t('More information about formatting options'), 'filter/tips') .'</p>';
}
?>

<?php
function l($text, $path, $options = array()) {
  global $language;

  // Merge in defaults.
  $options += array(
      'attributes' => array(),
      'html' => FALSE,
    );

  // Append active class.
  if (($path == $_GET['q'] || ($path == '<front>' && drupal_is_front_page())) &&
      (empty($options['language']) || $options['language']->language == $language->language)) {
    if (isset($options['attributes']['class'])) {
      $options['attributes']['class'] .= ' active';
    }
    else {
      $options['attributes']['class'] = 'active';
    }
  }

  // Remove all HTML and PHP tags from a tooltip. For best performance, we act only
  // if a quick strpos() pre-check gave a suspicion (because strip_tags() is expensive).
  if (isset($options['attributes']['title']) && strpos($options['attributes']['title'], '<') !== FALSE) {
    $options['attributes']['title'] = strip_tags($options['attributes']['title']);
  }

  return '<a href="'. check_url(url($path, $options)) .'"'. drupal_attributes($options['attributes']) .'>'. ($options['html'] ? $text : check_plain($text)) .'</a>';
}
?>