Error message

  • Deprecated function: Optional parameter $data declared before required parameter $info is implicitly treated as a required parameter in include_once() (line 1445 of /home/fdm/hamuf.com/knowledge/includes/bootstrap.inc).
  • Deprecated function: Return type of DateObject::__wakeup() should either be compatible with DateTime::__wakeup(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in include_once() (line 143 of /home/fdm/hamuf.com/knowledge/sites/all/modules/date/date_api/date_api.module).
  • Deprecated function: Return type of DateObject::format($format, $force = false) should either be compatible with DateTime::format(string $format): string, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in include_once() (line 143 of /home/fdm/hamuf.com/knowledge/sites/all/modules/date/date_api/date_api.module).
  • Deprecated function: Return type of DateObject::setTimezone($tz, $force = false) should either be compatible with DateTime::setTimezone(DateTimeZone $timezone): DateTime, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in include_once() (line 143 of /home/fdm/hamuf.com/knowledge/sites/all/modules/date/date_api/date_api.module).
  • Deprecated function: Optional parameter $input declared before required parameter $form_state is implicitly treated as a required parameter in include_once() (line 1445 of /home/fdm/hamuf.com/knowledge/includes/bootstrap.inc).
  • Deprecated function: Optional parameter $rrule declared before required parameter $item is implicitly treated as a required parameter in include_once() (line 1445 of /home/fdm/hamuf.com/knowledge/includes/bootstrap.inc).
  • Deprecated function: Optional parameter $rrule_values declared before required parameter $item is implicitly treated as a required parameter in include_once() (line 1445 of /home/fdm/hamuf.com/knowledge/includes/bootstrap.inc).
  • Deprecated function: Optional parameter $data declared before required parameter $name is implicitly treated as a required parameter in require_once() (line 342 of /home/fdm/hamuf.com/knowledge/includes/module.inc).
  • Deprecated function: Optional parameter $data declared before required parameter $name is implicitly treated as a required parameter in require_once() (line 342 of /home/fdm/hamuf.com/knowledge/includes/module.inc).
  • Deprecated function: Optional parameter $file declared before required parameter $entity_type is implicitly treated as a required parameter in require_once() (line 342 of /home/fdm/hamuf.com/knowledge/includes/module.inc).
  • Deprecated function: Optional parameter $account declared before required parameter $entity_type is implicitly treated as a required parameter in require_once() (line 342 of /home/fdm/hamuf.com/knowledge/includes/module.inc).
  • Deprecated function: Optional parameter $entity declared before required parameter $entity_type is implicitly treated as a required parameter in require_once() (line 342 of /home/fdm/hamuf.com/knowledge/includes/module.inc).
  • Deprecated function: Optional parameter $account declared before required parameter $entity_type is implicitly treated as a required parameter in require_once() (line 342 of /home/fdm/hamuf.com/knowledge/includes/module.inc).
  • Deprecated function: Optional parameter $values declared before required parameter $entity_type is implicitly treated as a required parameter in require_once() (line 342 of /home/fdm/hamuf.com/knowledge/includes/module.inc).
  • Deprecated function: Optional parameter $view_mode declared before required parameter $entity_type is implicitly treated as a required parameter in require_once() (line 342 of /home/fdm/hamuf.com/knowledge/includes/module.inc).
  • Deprecated function: Optional parameter $langcode declared before required parameter $entity_type is implicitly treated as a required parameter in require_once() (line 342 of /home/fdm/hamuf.com/knowledge/includes/module.inc).

Create new display format for a node file field

English

Need: I have a content type with a File field. When this field is displayed, I want it to show only icon without any text.
The current formats are either "Generic file" (icon + file name), "Table of files" (icon + file name + size) and "URL to file" (the entire file's URL).
I want to add a format "File icon", that will display an icon that utilizes as a link to the file.

What I did:
I created a very simple module called "File icon". I placed the file_icon directory in sites\default\modules

Found a related article

files: 
AttachmentSize
Plain text icon file_icon.info_.txt176 bytes
Plain text icon file_icon.module.txt1.83 KB