Search Layout

Author Message

Masamune

Thursday 02 June 2005 5:19:20 am

I know how to override the template for adv. Search, but what if I want to change the layout:

- I may override the pagelout for search - but how? - usuallay we speicfy node, class, section..

- Do some logic in the pagelayout - but how? - same problems, how to catch the module variable to know it's for adv. search..

cheers..

Ɓukasz Serwatka

Thursday 02 June 2005 5:22:20 am

Hi,

You can try to use "layout" module (settings/layout.ini), and pass variable via GET to the template. Then use search operator and loop to present result.

Here you can read more about custom search box
http://ez.no/ez_publish/documentation/customization/components/search/custom_search_box

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Masamune

Thursday 02 June 2005 5:42:23 am

Thank you for the tip..
It worked well except one problem:

Suppose I associated searchLayout.tpl to search.tpl
I should write in the url:
<i>../layout/set/searchLayout/search</i>
This worked well, but then what's happening, all relative paths are being preceded by layout/set/searchLayout/

Suppose for example I have a normal uri : <i>/content/view/full/104</i>
when accessing this uri from the searchLayout after using the layout module the uri becomes:
<i>../layout/set/searchLayout/search/content/view/full/104</i>

Any possible reason for this problem.. 10x.

Joel Hardi

Sunday 24 July 2005 11:46:05 am

I find it easier to just use some logic in pagelayout.tpl, like you first suggested. Just use a {section} like this:

{section show=or($module_result.uri|contains('content/search'), 
                 $module_result.uri|contains('content/advancedsearch'))}
{include uri="design:search_sidebar.tpl"}
{section-else}
{include uri="design:regular_sidebar.tpl"}
{/section}

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 19:39:12
Script start
Timing: Jan 18 2025 19:39:12
Module start 'layout'
Timing: Jan 18 2025 19:39:12
Module start 'content'
Timing: Jan 18 2025 19:39:13
Module end 'content'
Timing: Jan 18 2025 19:39:13
Script end

Main resources:

Total runtime0.5724 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 587.7813152.6094
Module start 'layout' 0.00560.0033 740.390639.3984
Module start 'content' 0.00890.5624 779.7891593.3203
Module end 'content' 0.57120.0012 1,373.109412.2031
Script end 0.5724  1,385.3125 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.5483160.0002
Check MTime0.00130.2327160.0001
Mysql Total
Database connection0.00080.142610.0008
Mysqli_queries0.519990.8167620.0084
Looping result0.00050.0959600.0000
Template Total0.543895.020.2719
Template load0.00190.336120.0010
Template processing0.541894.651320.2709
Template load and register function0.00010.017310.0001
states
state_id_array0.00060.109510.0006
state_identifier_array0.00090.157020.0004
Override
Cache load0.00170.2917290.0001
Sytem overhead
Fetch class attribute can translate value0.00110.191630.0004
Fetch class attribute name0.00100.170660.0002
XML
Image XML parsing0.00110.200930.0004
class_abstraction
Instantiating content class attribute0.00000.002370.0000
General
dbfile0.00090.1612240.0000
String conversion0.00000.002140.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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs