ezFind different result template - help!!

Author Message

Ivan Švogor

Friday 10 December 2010 1:47:24 am

Hello!

I'm using ezFind to search for news (articles), documents (file) and so on... On the page with documents I have a form with dorpdown where my user can select document category... My problem is with customizing the result page. Instead of using search.tpl or advancedserch.tpl, I want to use mysearch.tpl, but only when I search from this documents page. If I override search.tpl or advancedsearch.tpl it will be overriden for all templates, but I want it mysearch.tpl only when I search documents.

On the form, i have action on content/search, It would be cool if I could have something like content/mysearch -> and everithing reamins the same, except it uses mysearch.tpl

Can I get any help on how to do this?

Gaetano Giunta

Friday 10 December 2010 2:37:53 am

Just override search.tpl, and in the new version add an if{$yourcondirtion}{include uri='design:yourtpl'}{else}rest of code...{/if}

$yourcondition might be an extra variable you add to the form

Principal Consultant International Business
Member of the Community Project Board

Ivo Lukac

Friday 10 December 2010 2:43:25 am

There are several ways how you can you make it work, here are some of them:

  1. copy the content/search.php view to your own module and change the template
  2. make a special siteaccess which will have additional design with your custom search.tpl
  3. override your documents template and add custom ezfind fetch there (my choice)

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Ivan Švogor

Friday 10 December 2010 6:01:28 am

Thanks folks!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.