We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26085
    • 494 Posts
    Сталкнулся с проблеммой создания ссылок для просмотра дочерних галерей в MaxyGallery.
    После нескольчих часов мучений решил всё таки взять и написать простенький сниппет.
    За это я и люблю МОДХ. Что порой 10 строчек кода могут решить любую нестандартную задачу
    <?php
    /**
     * Wrapper for Ditto
     * [email protected]
     */
    $docid = $modx->documentIdentifier;
    
    $sql = $modx->dbQuery('select id, pagetitle from ' . $modx->getFullTableName('site_content') .
        ' where parent ='.$docid.'');
    
    while ($row = $modx->fetchRow($sql))
    {
        $child_id = $row['id'];
        $title 	  = $row['pagetitle'];
    
    	$tpl = '@CODE: 	<table width="220" cellspacing="0" cellpadding="0" border="0">
    									<tbody>
    										<tr style="background-color: rgb(191, 183, 172);" onmouseover="this.style.backgroundColor=\'#e0dbd4\'" onmouseout="this.style.backgroundColor=\'#bfb7ac\'">
    											<td width="8">
    											</td>
    											<td width="12">
    												<img width="7" height="11" src="assets/site/img/pfeil_nav02.gif" alt=""/>
    											</td>
    											<td>
    												<a href="[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]" rel="lightbox[set[+maxigallery.picture.gal_id+]]" class="imgBorder" id="unter_menue_weiss">
    												'.$title.'
    												</a>
    											</td>
    										</tr>
    									</tbody>
    								</table>';
    	
    	$params['gal_query_ids'] = $child_id;
    	$params['display'] = 'embedded';
    	$params['embedtype'] = 'slimbox';
    	$params['order_by'] = 'pos';
    	$params['limit'] = '1';
    	//$params['galleryPictureTpl'] = 'mgA';
    	$params['galleryPictureTpl'] = $tpl;
    	
    	print $modx->runSnippet('MaxiGallery', $params);
    	
    	$params['gal_query_ids'] = $child_id;
    	$params['display'] = 'embedded';
    	$params['embedtype'] = 'slimbox';
    	$params['order_by'] = 'pos';
    	$params['limit'] = '999';
    	$params['galleryPictureTpl'] = 'mgGalPicTplHidden';
    	print $modx->runSnippet('MaxiGallery', $params);
    }
    
    ?>