Studio Graou wrote:Mon problème est le suivant: path ne fonctionne pas et je suis obligé de le remplacer par l'adresse du répertoire, c'est assez long car j'ai beaucoup de galeries client et ce serait bien si l'attribut path fonctionnerais correctement..
To be honest, since there is already a download button for images, we never meant to integrate a dynamic method to create a download path for the image. I see now that it could be useful, so I will add a dynamic var {image_path} to next release. In the meantime, you need to use this javascript hack ... Add it to
settings -> custom -> custom javascript:
function x3_load_page(){
$('div.gallery.images').each(function(index, el) {
var items = $(this).find('a');
items.each(function(index, el) {
var image_path = $(this).data('image'),
title = $(this).find('h2.title'),
description = $(this).find('p');
if(title.length) {
title.html(title.html().replace(/{image_path}/g, image_path));
$(this).attr('data-title', $(this).attr('data-title').replace(/{image_path}/g, image_path));
}
if(description.length) {
description.html(description.html().replace(/{image_path}/g, image_path));
$(this).attr('data-description', $(this).attr('data-description').replace(/{image_path}/g, image_path));
}
});
});
}
Then you can use new {image_path} variable. For example:
<a href="{image_path}" class="button small" target="_blank" download>Download</a>
---
Pour être honnête, car il existe déjà un bouton de téléchargement pour les images, on n'a jamais voulu dire à intégrer une méthode dynamique pour créer un chemin de téléchargement de l'image. Je vois maintenant que cela pourrait être utile, je vais ajouter un var dynamique {image_path} pour la prochaine version. Dans l'intervalle, vous devez utiliser ce hack javascript ... Ajouter à paramètres -> personnalisé -> personnalisé javascript.