How to make description field (which is usually disabled but we can enable it) to allow html tags so that we can write html tags in description field and can link to other files etc.

Comments

Yuki’s picture

Could somebody help me please.

asak’s picture

I'm looking for a solution for this as well... will update when i find one ;)

asak’s picture

Ok - played with this some, and found that the following works:

Change the code in filefield_handler_field_data.inc (line 38):

  function render($values) {
    $values = drupal_clone($values); // Prevent affecting the original.
    $data = unserialize($values->{$this->field_alias});
    //$data = $values->{$this->field_alias};
    $values->{$this->field_alias} = $data[$this->options['data_key']];
	$passme = $values->{$this->field_alias};
    //return parent::render($values);
    return check_markup($passme, $this->options['format'], FALSE);
  }
Yuki’s picture

Nothing has changed after changing the code even clearing the cached data...the requirement is the file should be there but there will be a separate description field of that file and If I write any url over in that description it should link to that url.

quicksketch’s picture

Status: Active » Closed (fixed)

Override the theme_filefield_file() function in your template.php file within your theme if you'd like to use HTML in your descriptions. I'm closing this issue after lack of activity.

pacome’s picture

Status: Closed (fixed) » Active

I also need do to it, but i don't know -neither find- with what to override the theme_filefield_file() function to allow html in the description field (i'm not talking PHP fluently).
The final use would be to have a text area with a limited ckeditor profile activated, allowing people to select custom fonts, inserting links etc..

Any help about the overriding for html & text area would be gratefully appreciated!

thx
-P-

quicksketch’s picture

Status: Active » Closed (fixed)

The FileField queue isn't really the place for instruction on theming, see this handbook page on getting started with overriding theme functions: http://drupal.org/node/457740