ZenphotoCMS Forum
Limiting search to specific album(s) - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Limiting search to specific album(s) (/thread-9731.html)



Limiting search to specific album(s) - jackdaw - 2012-03-03

In my gallery I have two main albums, like photography and painting. Within these albums lots of subalbums.

When I do a search within one of the albums within photography I'd like to get results only from that main album or one of its subalbums. And when I do a search within one of the albums within paintings I'd like to get results only from that main album or one of its subalbums.

Is this possible? I could make two themes for each of those main albums, but I don't know how to adjust the searchform. Can it be done with the objects_list?

$objects_list: optional array of things to search eg. [albums]=>[list], etc. if the list is simply 0, the objects will be omitted from the search




Limiting search to specific album(s) - acrylian - 2012-03-03

Yes. Use `array('albums' =>array('album-to-search1,album-to-search2,…')); Example for categories also on Zenpage theme's news.php.

BTW you don't need two full themes actually. Either a simple check for the current/parent album or using the multiple_layouts plugins should do it as well.




Limiting search to specific album(s) - jackdaw - 2012-03-03

Thanks!




Limiting search to specific album(s) - sbillard - 2012-03-03

The Effervescence+, Garland, and Zenpage themes all have the code so that a search performed from an album page occurs only within that album.

$album_list = array('albums'=>array($_zp_current_album->name),'pages'=>'0', 'news'=>'0'); printSearchForm(NULL, 'search', $_zp_themeroot.'/images/search.png', gettext('Search within album'), NULL, NULL, $album_list);
No special test or theme needed.