-
- 108 Posts
The following code is used in my AdvSearch result template to display an image among other tvs :
[[GalleryItem? &id=`[[getPicId? &imageTV=`[[+tvMainPic]]`]]` &toPlaceholders=`0` &tpl=`tplGalleryitem` ]]
I have to call a
&tpl instead of using placeholders, due to some caching issue.
tplGalleryitem chunk is:
<a href="[[+url:is=``:then=`[[+image]]`:else=`[[+url]]`]]">
<img src="[[+image]]" alt="[[+name]]" />
</a>
... and everything works fine, except that it outputs an error also and before all :
Notice: Undefined variable: output in C:\my\path\core\cache\includes\elements\modsnippet\9.include.cache.php on line 133
which is
if (empty($tpl)) return '';
$output .= $gallery->getChunk($tpl,$itemArray);
return $output;
}
( = line 128 here :
https://github.com/splittingred/Gallery/blob/develop/core/components/gallery/elements/snippets/snippet.galleryitem.php )
Can someone have a look at this please ? I can't fix this for myself...
modx 2.2.7
[ed. note: kehezen last edited this post 10 years, 11 months ago.]
Sorry for that ⇧ , I'm no dev but I wanna try
-
- 108 Posts
I'm still struggling with that issue.
This is my call
[[GalleryItem? &id=`[[getPicId? &imageTV=`[[+tvMainPic]]`]]` &toPlaceholders=`1` &tpl=`tplGalleryitem` &imageWidth=`750` &imageHeight=`562` &imageZoomCrop=`0` ]]
The
Notice : Undefined variable appears when I set
&toPlaceholders to 0, no matter if I add the
&tpl property or not. The fact is that my tpl is called, and everything works fine... except that error that messes it all.
Can someone please have a look at this ?
[ed. note: kehezen last edited this post 10 years, 11 months ago.]
Sorry for that ⇧ , I'm no dev but I wanna try
discuss.answer
-
- 108 Posts
okay I solved this by removing the dot in this line
$output .= $gallery->getChunk($tpl,$itemArray);
This is at the bottom of the GalleryItem snippet.
I don't know if this is viable. I don't even know what .= means, nor what the dot implies.
However, it seems to be ok. Feel free to tell me what kind of mess I might have done.
Sorry for that ⇧ , I'm no dev but I wanna try
-
- 108 Posts
haha.. actually i vaguely knew the dot has something to do with concatenation. Vaguely.
Anyway thanks for the tip I managed to ignore until today !
Sorry for that ⇧ , I'm no dev but I wanna try