I have a gallery of artists' galleries containing sub-named with the name of each artist.
I want to display all images of sub-galleries.
dir="artists /*" does not work, how can I do?
[solved]Gallery : view all images sub-galleries
[solved]Gallery : view all images sub-galleries
Last edited by Jean le Chauve on Tue Sep 04, 2012 3:53 pm, edited 1 time in total.
Re: Gallery : view all images sub-galleries
I've never seen an option like that for the gallery module. The only way to display all images is to put them in the same folder or call the module for each directory (naming the specific directory and path) or use another module that handles categories, perhaps albums or use listit2, that might work.
Re: Gallery : view all images sub-galleries
Thanks Carasmo
I bypassed the problem with action="showlatest" number="2000" and a suitable template.
I leave open a few days if ever there was someone with a different solution.

I bypassed the problem with action="showlatest" number="2000" and a suitable template.
I leave open a few days if ever there was someone with a different solution.
Re: Gallery : view all images sub-galleries
It is possible, just create a new gallery-template for the first page, with nothing more than this code:
Assign this template to the subgallery where you have the subgalleries of the artists
Then set the gallery template of your choice (e.g. Fancybox) as default.
If you just want to show the first thumbnail and the rest hidden, you can change the template as described in this forumpost: http://forum.cmsmadesimple.org/viewtopic.php?t=41491
Code: Select all
{foreach from=$images item=image}
{if $image->isdir}
{Gallery id=$image->fileid}
{/if}
{/foreach}
Then set the gallery template of your choice (e.g. Fancybox) as default.
If you just want to show the first thumbnail and the rest hidden, you can change the template as described in this forumpost: http://forum.cmsmadesimple.org/viewtopic.php?t=41491
Re: Gallery : view all images sub-galleries
Excellent! Thanks!
Re: Gallery : view all images sub-galleries
In fact, I need to display all the images with a custom field equal to a certain value.
Jos, your system works perfectly, but creates many queries to db (like my first solution) ...
So I created a UDT:
And I get the desired result in a single query 
Jos, your system works perfectly, but creates many queries to db (like my first solution) ...
So I created a UDT:
Code: Select all
$db = cmsms()->GetDb();
$smarty = cmsms()->GetSmarty();
$sql = "SELECT filepath,filename
FROM ".cms_db_prefix()."module_gallery
INNER JOIN ".cms_db_prefix()."module_gallery_fieldvals ON ".cms_db_prefix()."module_gallery.fileid = ".cms_db_prefix()."module_gallery_fieldvals.fileid
WHERE ".cms_db_prefix()."module_gallery_fieldvals.value = 'AfficheIn'";
$dbretour = $db->Execute($sql);
echo "<div class='affichesCycle'>";
while ($row = $dbretour->FetchRow())
{
$image="uploads/images/Gallery/".$row['filepath'].$row['filename'];
echo '<div class="affiches"><a href="agenda">';
$smarty_data = "{cms_module module='CGSmartImage' src='$image' alias='afficheAccueil'}";
echo $smarty->display('string:'.$smarty_data);
echo '</a></div>';
}
echo "</div>";

Re: [solved]Gallery : view all images sub-galleries
Great stuff!