Search button for Directory listing


Home Forums Front End PM PRO Search button for Directory listing

This topic is: Resolved
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #17379
    Andrew Perryman
    Participant

    Hi Shamim,

    I know that, if I part type a name in the directory search field then press enter it will search and list those that match as per attached screen shot but our users will not know intuitively how to do this so is it possible to add a search button next to the search input field as per my attached picture (screenshot).

    look forward to your thoughts on this for the next release?

    Andrew

    Attachments:
    You must be logged in to view attached files.
    #17383
    Shamim Hasan
    Keymaster

    You can add following code in your theme’s (child theme’s if any) functions.php

    add_filter( 'fep_directory_output', function( $output ){
    	$pos = strpos( $output, '<input type="hidden" name="feppage"' );
    	if ( $pos !== false ) {
    		$output = substr_replace( $output, '<input type="submit" value="Search" />', $pos, 0 );
    	}
    	return $output;
    });
    

    it may break in future.

    OR you can override directory.php template to add that button. Instruction to override template in https://www.shamimsplugins.com/docs/front-end-pm-pro/customization-front-end-pm-pro/change-templates/

    #17391
    Andrew Perryman
    Participant

    Morning Shamim,

    I decided to take a cleaner approach, so I created a directory “front-end-pm” in the root of my child theme as directed per your instructions and placed a copy of the Directory.php in it.

    I placed this entry..
    <input type="submit" value="Find" />
    as the last entry in the <form> tag structure as per the attached screenshot, in the directory.php.

    Will this mean it is less likely to break in the future, are there plans to change the code structure for the directory.php file?

    If so I can wait or just keep an eye out for for the changes and remove the bypass after your update if there is to be a change?

    Kind regards..

    Andrew

    Attachments:
    You must be logged in to view attached files.
    #17395
    Shamim Hasan
    Keymaster

    overriding template works as follows
    If in future any template is modified in this plugin and you already overridden that template in your child theme then your template will be used instead of this plugins one. So if any new option or anything added in this template that you will not get until you add that in your template manually.

    Currently no plan to change in directory.php but you should keep an eye when update this plugin in future. Most of the time any template change is mentioned in changelog. If is better always read changelog before update (for any plugin)

    #17401
    Andrew Perryman
    Participant

    Thanks Shamim,

    I will keep an eye on the update change log as you suggest.

    Topic marked as resolved..

    Andrew.

Viewing 5 posts - 1 through 5 (of 5 total)

You need to purchase ‘Front End PM PRO’ to create topic in this support forum.

If you already purchased ‘Front End PM PRO’ please LOGIN.