would it be possible to add the functionality of creating a gallery for every new ressource ( that got the Easy2Gallery call in it ), so that you wouldn’t need to add the gallery id by hand?
...got a little workaround in order to connect a ressource with a gallery ( without entering the gallery ID to the Snippet call manually )
1. create a Snippet "select2gal"
<?php
$output = '';
$result = $modx->db->query( 'SELECT cat_name, cat_id FROM `modx_easy2_dirs` ' );
$gallarray = $modx->db->makeArray( $result );
$num_rows = mysql_num_rows($result);
$lastgall = ($num_rows)-1;
for ($i = 0; $i < $lastgall ; $i++) {
$firstitems .= $gallarray[$i][cat_name];
$firstitems .= '==';
$firstitems .= $gallarray[$i][cat_id];
$firstitems .= '||';
}
$lastitem = $gallarray[$lastgall][cat_name] . '==' . $gallarray[$lastgall][cat_id];
$output = "$firstitems $lastitem";
return $output;
?>
2. create a new TV "galleries"
Input Type: DropDown List Menu
Input Option Values:
@EVAL return $modx->runSnippet('select2gal');assign it to your template
3. create a Gallery Template with your easy2gallery call like in it e.g.
[!easy2?gid=[*galleries*]&w=100&h=100&thq=90!]
important is that part: gid=[*galleries*]
4. now you’ll be able to select the gallery from a DropDown Menu and connect it with your ressource
... guess i could extend it to output nothing if no gallery has been selected
hope this makes sense

j
*edit:
okay, i’ll rewrite it a bit to get rid of the last double pipes ... please correct if it’s too bad - i’m a php noooooob

/ it’s working