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.

eZ debug

Timing: Jan 18 2025 04:56:36
Script start
Timing: Jan 18 2025 04:56:36
Module start 'layout'
Timing: Jan 18 2025 04:56:36
Module start 'content'
Timing: Jan 18 2025 04:56:37
Module end 'content'
Timing: Jan 18 2025 04:56:37
Script end

Main resources:

Total runtime0.5632 sec
Peak memory usage4,096.0000 KB
Database Queries64

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 588.0625152.6406
Module start 'layout' 0.00690.0046 740.703139.4844
Module start 'content' 0.01140.5504 780.1875592.3672
Module end 'content' 0.56180.0014 1,372.554712.1172
Script end 0.5632  1,384.6719 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.7707160.0003
Check MTime0.00140.2469160.0001
Mysql Total
Database connection0.00060.115410.0006
Mysqli_queries0.502089.1242640.0078
Looping result0.00080.1392620.0000
Template Total0.513091.120.2565
Template load0.00230.404620.0011
Template processing0.510790.677320.2554
Template load and register function0.00020.041010.0002
states
state_id_array0.00170.304810.0017
state_identifier_array0.00100.182920.0005
Override
Cache load0.00200.3495200.0001
Sytem overhead
Fetch class attribute can translate value0.00070.131030.0002
Fetch class attribute name0.00310.550960.0005
XML
Image XML parsing0.00140.248430.0005
class_abstraction
Instantiating content class attribute0.00000.002560.0000
General
dbfile0.00210.3664230.0001
String conversion0.00000.001840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
1content/datatype/view/ezxmltags/ol.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ol.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs