developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.
Opened 13 years ago
Last modified 9 years ago
#591 confirmed enhancement
plugin image : si l'image n'existe pas ne pas mettre de balise
Reported by: | Lipki | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | jelix:plugins:tpl | Version: | 1.0.4 |
Severity: | minor | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Documentation needed: | no | |
Hosting Provider: | Php version: |
Description
Si l'image n'existe pas ne pas mettre de balise.
Attachments (1)
Change History (14)
comment:1 Changed 13 years ago by Lipki
comment:2 Changed 13 years ago by Lipki
- review set to review?
comment:3 Changed 13 years ago by bastnic
pourquoi faire ça sous forme de plugin ?
comment:4 Changed 13 years ago 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.
comment:5 Changed 13 years ago by laurentj
- review review? deleted
comment:6 Changed 13 years ago 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 ?
comment:7 Changed 13 years ago by Lipki
it's good for me !
Changed 13 years ago by Lipki
comment:8 Changed 13 years ago by Lipki
- review set to review?
- Version changed from 1.0.3 to 1.0.4
comment:9 Changed 13 years ago 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.
comment:10 Changed 13 years ago by Lipki
- review changed from review? to review-
comment:11 Changed 13 years ago by laurentj
- review review- deleted
comment:12 Changed 11 years ago by laurentj
- Component changed from jelix:plugins to jelix:plugins:tpl
comment:13 Changed 9 years ago by laurentj
- Status changed from new to confirmed
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.