Ticket #591 (new enhancement)

Opened 3 months ago

Last modified 1 month ago

plugin image : si l'image n'existe pas ne pas mettre de balise

Reported by: Lipki Assigned to:
Priority: low Milestone:
Component: jelix:plugins Version: 1.0.4
Severity: minor Keywords:
Cc: Php version:
Review: Hosting Provider:
Documentation needed: 0 Blocking:

Description

Si l'image n'existe pas ne pas mettre de balise.

Attachments

image.diff (1.3 kB) - added by Lipki on 07/21/08 15:05:44.

Change History

05/20/08 10:30:43 changed by Lipki

Je ne suis pas pour cette modification, la balise image affiche une image, si le fichier est absent l'attribut alt entre en action.

Par contre, on peut créer un plugin "isFile" pour tester dans les templates la présence du fichier.

Cela permettra également de détecter les liens morts.

06/07/08 12:26:04 changed by Lipki

  • review set to review?.

06/07/08 14:07:24 changed by bastnic

pourquoi faire ça sous forme de plugin ?

06/07/08 15:34:30 changed by Lipki

Si tu parle du plugin is_file, c'est juste une proposition comme ça, j'ai pas vraiment réfléchit...

Ce que je dit surtout c'est que ce n'est pas au plugin image de vérifier l'existence de l'image.

06/10/08 15:59:19 changed by laurentj

  • review deleted.

07/02/08 11:03:14 changed by bballizlife

I agree with Lipki too. The plugin image should display an image, nothing else. If the image does not exist, never mind, alt attribute is there, with and height attributes will have the effect of doing as if the image exists by taking the same space on the page. That's the web ;)

Nevertheless, there could be and option to this plugin telling to do the check or not.

Think about something like this :

  • not_exists = false (default value, the plugin does not check)
  • not_exists = true (plugin will do the check and won't display the <img> tag if it does not exist)
  • not_exists = path/to/default/img (a string as path to a default image to display if the image does not exist). Could be usefull in some cases.

What to you think about that ?

07/21/08 11:21:09 changed by Lipki

it's good for me !

07/21/08 15:05:44 changed by Lipki

  • attachment image.diff added.

07/21/08 15:06:43 changed by Lipki

  • review set to review?.
  • version changed from 1.0.3 to 1.0.4.

07/21/08 15:09:49 changed by Lipki

Si le plugin ne trouve pas d'image, il ajoute quand même une balise image vide.

Si vous ne voulais pas que la balise img apparaisse, il suffit de le dire.

{image 'data/fichiers/toupie2.png', array('notexists'=>true)}

Mais si vous avez une image de remplacement prévu pour ce cas, il vous faudra spécifier l'url.

{image 'data/fichiers/toupie2.png',
    array('width'=>100,
          'notexists'=>'data/fichiers/pastoupie.png')}

Une fois que l'image manquante aura pris sa place sur le serveur, elle sera visible directement.

07/21/08 15:14:29 changed by Lipki

  • review changed from review? to review-.

07/23/08 10:59:05 changed by laurentj

  • review deleted.
Download in other formats: Comma-delimited Text Tab-delimited Text RSS Feed