Skip to main content
  • English
  • Español
  • Français

United
Nations

 

Office for Outer Space Affairs
UN-SPIDER Knowledge Portal

  • Inicio
  • Sobre nosotros
    • Sobre ONU-SPIDER
    • Acerca de UNOOSA
    • Publicaciones
    • Ofertas de trabajo
    • Conozca el Equipo
    • Contacto
  • Aplicación Espacial
    • Guías Tecnológicas
    • Mecanismos de Emergencia
    • Mecanismos de Recuperación
    • Red Internacional de Alerta de Asteroides
    • Grupo Asesor para la Planificación de Misiones Espaciales
    • Iniciativa Internacional sobre Meteorología Espacial
    • Tecnologías Espaciales en la ONU
    • Historias de Usuarios
  • Enlaces y Recursos
    • Aplicación de datos del mes
      • Disaster Recovery
    • Fuentes de Datos
    • SIG y Software de Percepción Remota
    • Recursos de capacitación en línea
    • Instituciones
  • Riesgos y Desastres
    • Gestión del Riesgo de Desastres
    • Alerta temprana
    • Gestión de Desastres y Emergencias
    • Amenazas Naturales
    • El Proceso de la Reducción de Desastres Post-2015
    • La ONU y la Gestión del Riesgo de Desastres
    • La ONU y Alerta Temprana
    • La ONU y la Gestión de Desastres
  • Asesoría
    • Misiones de Asesoría
    • Apoyo en caso de Emergencia
    • Asesoría Virtual
    • Prácticas Recomendadas
    • Actividades de Entrenamiento
    • Usos Prácticos
  • Redes
    • Oficinas Regionales de Apoyo
    • GP-STAR
    • IN-MHEWS
    • IWG-SEM
  • Proyectos
    • SPEAR
    • FOSAT-S
    • EvIDENz
    • Flood GUIDE
  • Noticias y Eventos
    • Noticias
    • Eventos
    • Eventos pasados

Breadcrumb

  • Home
  • Reenabled Caption On Main-Article-Image
  • Reenabled Caption on Main-Article-Image

Reenabled Caption on Main-Article-Image

By admin_wla | Tue, 27 Apr 2021 - 09:34

In the Drupal 7 version the caption of the main article images was handelt by two bits:

  • The function hook_preprocess_image() in the theme to add the class "caption" to the image tag
  • The module image_caption which added a jQuery-Function to do the work

The module doesn't exist for Drupal 8. The preprocess_image hook luckily still is available.

  • With adding the function in the .theme-file of our theme, it was feasable to add the class "caption" to an image set by an image-field when the images style is w225xh150.
  • The jQuery-Function was put into the themes js directory into the file "drupal8_w3css_subtheme.theme". There the function worked as in the Drupal 7 version.

Mission accomplished

Caution: when in Drupal 10 jQuery is eliminated, the script has to be rewritten.

Documentation
0
0
  • Printer-friendly version

Book traversal links for Reenabled Caption on Main-Article-Image

  • ‹ Changed Session Lifetime
  • Up
  • Workaround for bug Non-translatable fields can only be changed when updating the original language. ›

Footer menu

  • Contact
  • Terms of Use

User account menu

  • Log in