Limiting search to specific album(s)

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`

Comments

  • acrylian Administrator, Developer
    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.
  • Thanks! :)
  • 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.
Sign In or Register to comment.