added category id filter to functions.php, set up list view apply the filter
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 13 Apr 2017 15:46:02 +0000 (11:46 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 13 Apr 2017 15:46:02 +0000 (11:46 -0400)
to check for the ids in the category array

placed filter in functions.php that will allow the list view template in
the theme to have access to the set of manufacturer ids and compare them
to the categories in the category array supplied by the list model. this
is to build out of the list of manufacturers and brands for the search
widget

functions.php
glm-member-db/views/front/members/list.html

index a525adf..c32d70f 100644 (file)
@@ -19,7 +19,10 @@ if (!function_exists('glm_quicksite_widget_init')) {
     }
 
 }
-
+add_filter('manufacturer_ids', function(){
+    $ids = [3,11];
+   return $ids;
+});
 /**
  * Return the client info option for the given key
  *
index d10c636..5d2d69e 100644 (file)
@@ -2,6 +2,7 @@
     {if $settings.list_map_show_opened}map-opened{else}map-closed{/if}
     {if $settings.list_show_search_filters_opened}filters-opened{else}filters-closed{/if}
 ">
+
 {include file='front/members/header.html'}
         {apply_filters('glm-member-db-front-members-list-pageTop', '')}
 <div class="glm-member-list-inner-wrapper">
                                     </select>
                                 {/if}
                             </div>
+                             {$manufacturer_ids=apply_filters('manufacturer_ids', '')}
                             {if $settings.list_show_search_category}
                                 {$rvTypes = array()}
                                 {$rvManufacturers = array()}
                                 {$brands = array()}
                                 {foreach from=$categories item=v}
+                                   {if $v.id|in_array:$manufacturer_ids}
+                                  
+                                   {else}
+                                    
+                                   {/if}
                                     {if $v.parent == 'RV Classes'}
                                         {$rvTypes[$v.id] = $v}
                                     {elseif $v.parent == 'RV Manufacturers'}
                                     {/if}
                                 {/foreach}
                                 <div>
+                                   
+                                    {foreach $manufacturer_ids as $manufacturer_id}
+                                      
+                                    {/foreach}
                                     <select name="categorySearchMultiple[]" id="rvTypes" title="Click to Select Types" multiple="multiple">
                                         {foreach $rvTypes as $item => $v}
                                         <option value="{$v.id}"{if $v.default} selected="selected"{/if}>{$v.name}</option>