Need help to custom the advanced search template

Author Message

Sébastien Antoniotti

Monday 08 January 2007 2:07:21 am

Hi,

I'm looking for a solution to display only some classes in the first dropdown of the advancedsearch.tpl.

Actually the select is build like this :

<select name="SearchContentClassID">
<option value="-1">{"Any class"|i18n("design/standard/content/search")}</option>

{section name=ContentClass loop=$content_class_array }

<option {switch name=sw match=$search_contentclass_id}
{case match=$ContentClass:item.id}
selected="selected"
{/case}
{case}
{/case}
{/switch} value="{$ContentClass:item.id}">{$ContentClass:item.name|wash}</option>

{/section}
</select>

So I would like to custom the $content_class_array in order to manually specifiy the classes.

Thanks in advance !

eZ Publish Freelance
web : http://www.webaxis.fr

Stephane Cottin

Tuesday 13 January 2009 8:26:07 am

no reply / solution ?

Christophe Condomines

Wednesday 14 January 2009 1:04:30 am

You may define your own arrays of "content class id" and "content class name" in the template and loop on it. Or better, define the array in an .ini file

Something like:

{def $myCCID=hash(1=>'Folder',2=>'Article')}

{foreach $myCCID as  $id => $name}
  <option value="{$id}">{$name|wash}</option>
{/foreach}

Microblau SL
http://www.microblau.net

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 16:23:40
Script start
Timing: Jan 18 2025 16:23:40
Module start 'layout'
Timing: Jan 18 2025 16:23:40
Module start 'content'
Timing: Jan 18 2025 16:23:41
Module end 'content'
Timing: Jan 18 2025 16:23:41
Script end

Main resources:

Total runtime0.5322 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 588.0391152.6406
Module start 'layout' 0.00490.0022 740.679739.4766
Module start 'content' 0.00710.5233 780.1563573.3984
Module end 'content' 0.53050.0017 1,353.554712.1250
Script end 0.5321  1,365.6797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.5648160.0002
Check MTime0.00130.2363160.0001
Mysql Total
Database connection0.00090.161210.0009
Mysqli_queries0.486791.4466590.0082
Looping result0.00050.0906570.0000
Template Total0.508095.420.2540
Template load0.00180.333220.0009
Template processing0.506295.104020.2531
Template load and register function0.00010.021810.0001
states
state_id_array0.00070.129210.0007
state_identifier_array0.00070.128920.0003
Override
Cache load0.00150.2756170.0001
Sytem overhead
Fetch class attribute can translate value0.00040.078530.0001
Fetch class attribute name0.00110.199950.0002
XML
Image XML parsing0.00100.182430.0003
class_abstraction
Instantiating content class attribute0.00000.002150.0000
General
dbfile0.00090.1760220.0000
String conversion0.00000.001340.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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/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/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: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs