Put the Advanced Search Filter in a Block

Review on how to place the advanced search filter directly in a block on your PHPFox website

When browsing for users on your PHPFox website, there are certain criteria that you can choose from. There is also a button for advanced search criteria, which includes all of the custom fields you created on your website.


However, this makes things complicated for your users as they need to perform one additional click to get there. As we always try to optimize certain features and allow users easier access to different functions, we are glad to present a way of creating a custom block on the browse section of your website, which will display all of the advanced search options directly on the same page.


Initially, the browse section has an Advanced Filter button and it looks like this:


Preview of standard advanced filter block in PHPFox


To complete the tutorial, you will need to follow these steps:

Step 1 Create a Custom Block

First, you need to access the administrative area of your PHPFox website. Log into your website as administrator and then click on the AdminCP button at the top-right corner of the screen.


Access administrative panel in PHPFox


Click on the CMS tab at the tom menu and then Blocks > Add New Block.


Add custom block in PHPFox


Edit the Block Details:


  • Product: Select Core
  • Module: Select User
  • Title: Enter the title of the new block
  • Type: HTML Code
  • Controller: user > user.browse
  • Placement: Block 3
  • Active: Set the block as active/inactive


You also need to enter the following code:


<form method="post" action="{if isset($aCallback.url_home)}{url link=$aCallback.url_home view=$sView}{else}{url link='user.browse' view=$sView}{/if}">
<div class="block">
<div class="title">
          {phrase var='user.advanced_filters'}
{foreach from=$aCustomFields item=aCustomField}
          {template file='custom.block.foreachcustom'}
<input type="submit" value="{phrase var='user.browse_filter_submit'}" class="button" name="search[submit]" />


Choose the User groups that will have access to the block.


Edit block details in PHPFox


Hit the Submit button to keep the changes.


Step 2 Remove the Advanced Filter Button

If you wish to remove the Advanced Filter button from the browsing page, you will have to edit a core file of the product.


Void support

By editing core file of PHPFox, the support service their team provides will no longer be available for you. Thus, make sure that you are aware of the complications this may cause to your product before proceeding further.

To remove the button, you need to access the location of your PHPFox website via FTP. Then search for and access the following file:




where your-template is the actual template you are using on your website. Edit the file and remove the following lines from it (around line 72):


<ul id="js_user_browse_advanced_link">
          <li><a href="#" onclick="$('#js_user_browse_advanced').show(); return false;" id="user_browse_advanced_link">{phrase var='user.advanced_filters'}</a></li>
          {if isset($bIsInSearchMode) && $bIsInSearchMode}
                    <li><a href="#"><a href="{url link='user.browse'}">{phrase var='user.reset_browse_criteria'}</a></a>          </li>


When completing the changes above, the browse section on your website will look like the following screenshot.


Preview advanced filter block in PHPFox