Hi there,
This is baffling me, and it's not the first time.
I'm using modx 2.2.4, on XAMPP, windows 7; but I have seen it happen on about 6 different setups, so it is obviously something I am doing wrong.
I am using this snippet:
<?php
$output='';
$c = $modx->newQuery('modResource');
$c->where(
array(
'published' => true,
'deleted' => false,
)
);
if (count($ids) > 0) {
$c->where(
array(
"`id` IN (".$ids.")",
)
);
$c->sortby('menuindex','ASC');
$c->limit($limit);
$resources = $modx->getCollection('modResource',$c);
foreach ($resources as $resource) {
$resourceArray = array();
$resourceArray['id']=$resource->get('id');
$resourceArray['title']=$resource->get('longtitle');
$resourceArray['description']=$resource->get('description');
$resourceArray['Thumbnail'] = $resource->getTVValue('Thumbnail');
$output .= $modx->getChunk($tpl,$resourceArray);
}
return $output;
} to pull GalleryItem type TVs from resources, using this template:
<a href="[[~[[+id]]]]" title="[[+title]]" class="featured-project-image">[[+Thumbnail]]</a>
As you can see, I've stripped out everything except the link and the image.
Here is the snippet call:
<div id="featured-projects-bg">[[getThumbnails? &ids=`[[*Portfolio Items]]` &limit=`5` &tpl=`Tpl.thumbnail`]]</div>
wrapped in its div so you can see that there is no "
" in there.
And that is the problem, I am getting a set of double quotes and 2 lines of empty space before the snippet tpl output.
I have seen this before, as I mentioned, and have tried to just ignore it, but I would really like to know if it can be solved?
Oh, the TV type is from the Gallery component, available in the repo. It is todays version.
thnx for any advice -- including "your snippet sux", 'cause I would like to know if it's a really bad implimentation.
-g
[ed. note: unsub777 last edited this post 14 years, 3 months ago.]