Hide Search block on page if search parameter is not used

Hi All,

I want to create page for Ads to have below user experience.

  1. Once page is open user will get presented with search form and latest ads.
  2. Once user will set search parameter and click on search
  3. Search result block should get visible and latest job block should get hidden.

Could you please let me know your recomendation to achieve this?

If above is not possible then how I can redirect user to ads search page with all parameter?

I would like to simplify and have only 3 tabs on Ads home page (All Ads, Ads by Category and Manage Ads)

Thanks,

  • 214
  • More
Replies (6)
    • Hello @deep !

      I guess, you need to insert the blocks from the Ads search page to the Ads Home item.

      • If I will insert ads search block in ads home then I will have total 3 block on page. i have listed block in order it will be on page.

        1- Search Form Block - This is fine

        2 - latest Ads Block - This will be display latest ads as soon as user will land on ads ome page.

        3- Ads search Block - This block will be empty on first time user will come to Ads home page.

        So once user click on search form then I want latest ads block to be hieden and so result in ads search block.

        • It will require to have the custom JS / JQuery code which will hide this block before the submit of the search form.

          • I thought so and issue is that how Js will know if button is pressed ? i was not able to figure it out .. I was thinking that Page will refreshed and i can use any anchor to trigger Java Script and hide latest ads block. Any thoughts?

            • Yes, JQuery may "listen" the actions of the forms like:

              $( "#search_form_id" ).on( "submit", function( event ) {
                alert( "Handler for `submit` called." );
                event.preventDefault();
              });
              
              • To have the search results block not show before the search is done, go to developer and edit the block . In the code, change 'show_empty' from true to false.image_transcoder.php?o=sys_images_editor&h=2164&dpx=2&t=1721954393

                I have this same set up on my site but didn't know how to hide the Latest block after the search.

                Login or Join to comment.