Quick filter Exhibits Admin side

Hi,

I would like to know if there is a way to implement a quick filter in /admin/exhibits (like it is done in the Items Admin Browse Page /admin/items) in which only certain exhibits would be displayed. For instance: quick filter by Public, Private or Featured Exhibits.

I would also like to filter the exhibits by language (since I’m using the Multilanguage plugin ).
I have gone through the code but I did not find any easy solution so far. What might be the best approach to this?

Thanks

I have solved the first issue with the following: /admin/exhibits?featured=1 and /admin/exhibits?public=1 and /admin/exhibits?public=0

Still trying to figure out the second issue

The “language” data for an exhibit is presumably added by the Multilanguage plugin, so your ability to filter by it (or not) would be based in whether that plugin provides that option or not.

1 Like

@jordi3421 , not sure whether this could help you but I’ve just added Details and QuickFilter to the plugin in my fork and submitted it as a pull request to original developers. You’re free to get the changes and try to apply them to your case, in the meantime.

1 Like

I figured the language filter out.

Created a file in plugins/ExhibitBuilder/admin/exhibits/filter-language.php

<ul class="quick-filter-wrapper"style="float: right; margin-bottom: 15px;" >
	<li><a href="#"><?php echo __('Language'); ?></a>
	<ul class="dropdown">
        <li><span class="quick-filter-heading"><?php echo __('Quick Filter') ?></span></li>
        <li><a href="<?php echo url('exhibits/browse'); ?>"><?php echo __('View All') ?></a></li>
        <li><a href="<?php echo url('exhibits/browse', array('language' => 'ca_ES')); ?>"><?php  echo __('Catalan'); ?></a></li>
		<li><a href="<?php echo url('exhibits/browse', array('language' => 'es')); ?>"><?php echo __('Spanish'); ?></a></li>
		<li><a href="<?php echo url('exhibits/browse', array('language'=> 'en')); ?>"><?php  echo __('English');?></a></li>
    </ul>
	</li>
</ul> 

Added in the Exhibit.php table in plugins/ExhibitBuilder/models/table within the switch statement

case 'language': 
    $select->joinInner(array('m'=>$db->MultilanguageContentLanguages), 'm.record_id = exhibits.id and m.record_type="Exhibit"', array()); 
    $select->where('lang = ?', $paramValue);  
    break;

And also in the ExhibitFunctions.php (plugins/ExhibitBuilder/helpers) in the shortcode function

if (isset($args['language'])) {
        $params['language'] = $args['language'];
    }

P.S: @DanieleB I tried the changes and worked perfectly! Thanks!

Glad you made it work.
Cheers!

This topic was automatically closed 250 days after the last reply. New replies are no longer allowed.