<div class="dir">
<div class="boxcontent">
[+easy2:dirpluginprerender+]
<a href="javascript:void(0);" onclick="openGallery('[+easy2:id+]')">
<img src="[+easy2:src+]" alt="[+easy2:title+]" title="[+easy2:title+]-[+easy2:cat_summary+]" width="[+easy2:w+]" height="[+easy2:h+]" />
</a>
<div class="dirname thumbinfo">
<a href="[+easy2:link+]">
<b>[+easy2:title+]</b> ([+easy2:count+])
</a>
</div>
[+easy2:dirpluginrender+]
</div>
</div>
Change this as you like, because what you need is not thumbnail folders
function openGallery(galleryId) {
var dataToSend = {gid: galleryId};
$.ajax({
url: [~pageId~], // the hidden URL
data: dataToSend
}).done(function(data) {
$('wrapper').html(data);
});
}
NOTE: if you're using [~pageId~], then it should be on the template. Otherwise, if you use a javascript file, try to hardcode the link URL to the controller resource.
<?php
if (empty($_GET['gid'])) {
return '';
}
$output = '';
$easy2 = $modx->runSnippet('easy2', array(
'gid' => $_GET['gid']
));
$output .= $easy2;
return $output;
[!easy2? &w=`275` &h=`180` &ss_bg=`#fff` &rgid=`1` &thq=`90` &limit=`1` &showonly=`images` !]
http://rfsmn.ru почему?
что-то я не понял ничего =(1. create a new resource, make it hidden. let's say, its id is 100. NO TEMPLATE (make it blank).
там где javascript pageId мне создать новый ресурс? сделать его скрытым и Id ресурса туда поставить? А сниппет вызывать через modx api в этом ресурсе?
А на странице с фотографиями вызываю просто easy2 с шаблоном?