displaying only first img in search results as all but first image derivative are missing, still to fix
This commit is contained in:
parent
8a81ca1984
commit
987bc95326
File diff suppressed because one or more lines are too long
|
@ -154,15 +154,19 @@ export default {
|
||||||
let img_src = relations.images.data
|
let img_src = relations.images.data
|
||||||
console.log('img_src', img_src);
|
console.log('img_src', img_src);
|
||||||
// this is a temporary deactivation of images
|
// this is a temporary deactivation of images
|
||||||
img_src = [];
|
// img_src = [];
|
||||||
item.images = []
|
item.images = []
|
||||||
for (var j = 0; j < img_src.length; j++) {
|
for (var j = 0; j < img_src.length; j++) {
|
||||||
item.images.push({
|
if(img_src[j].meta.imageDerivatives){
|
||||||
title: img_src[j].meta.title,
|
item.images.push({
|
||||||
// meta.imageDerivatives.style.href link is provided by drupal consumers_image_styles module
|
title: img_src[j].meta.title,
|
||||||
// BUG: meta.imageDerivatives does not exists
|
// meta.imageDerivatives.style.href link is provided by drupal consumers_image_styles module
|
||||||
url: img_src[j].meta.imageDerivatives.links.card_medium.href
|
// BUG: missing all image derivative but first
|
||||||
})
|
url: img_src[j].meta.imageDerivatives.links.card_medium.href
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
console.warn('missing image derivative '+j+'/'+img_src.length+' for '+attrs.title);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
items.push(item)
|
items.push(item)
|
||||||
|
|
Loading…
Reference in New Issue