Writing a new search procedure. Error- View not found in module.

Author Message

Stuart Fenton

Thursday 30 January 2003 4:12:37 am

How do I write a new search module.

I did some initial test by overriding the search.tpl file by creating a copy in design/mydesign/content/search.tpl.

This works fine.

So I tried the next step of creating a new search routine. I created a new file called Search_directory.tpl and placed it in the same location. I then copied the search.php routine in the kernel/content/ directory and named it search_directory.php.

But when I access the search routine via the url

mysite/mydesign/content/search_directory/ I get a error message

View not found. The requested view 'search_directory' could not be found in module: 'content'

How do I go about linking this together so I can write the custom routine.

I know I could just use the search.tpl and alter it but I need the normal search left as is.

Any help would be appreciated.

Stuart Fenton

Thursday 30 January 2003 7:26:19 am

> How do I write a new search module.
>
> I did some initial test by overriding the search.tpl file by
> creating a copy in design/mydesign/content/search.tpl.
>
> This works fine.
>
> So I tried the next step of creating a new search routine. I
> created a new file called Search_directory.tpl and placed it
> in the same location. I then copied the search.php routine
> in the kernel/content/ directory and named it
> search_directory.php.
>
> But when I access the search routine via the url
>
> mysite/mydesign/content/search_directory/ I get a error
> message
>
>
> View not found. The requested view 'search_directory' could
> not be found in module: 'content'
>
> How do I go about linking this together so I can write the
> custom routine.
>
>
> I know I could just use the search.tpl and alter it but I
> need the normal search left as is.
>
> Any help would be appreciated.

I have figured out how to add my own search function by adding a new definition to the module.php file:

I added

$ViewList["search_directory"] = array(
"functions" => array( 'read' ),
"script" => "search_directory.php",
"params" => array( ) );

Into the file and it work fine now.

However is this the correct thing to do. Is there a place to put custom changes like this rather than altering the source code?

I hope this helps anyone trying to do the same thing.

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 11:20:26
Script start
Timing: Jan 18 2025 11:20:26
Module start 'layout'
Timing: Jan 18 2025 11:20:26
Module start 'content'
Timing: Jan 18 2025 11:20:27
Module end 'content'
Timing: Jan 18 2025 11:20:27
Script end

Main resources:

Total runtime0.6358 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 590.5625152.6875
Module start 'layout' 0.00620.0055 743.250039.5234
Module start 'content' 0.01160.6227 782.7734434.1875
Module end 'content' 0.63430.0015 1,216.96098.2344
Script end 0.6358  1,225.1953 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.5990160.0002
Check MTime0.00170.2637160.0001
Mysql Total
Database connection0.00080.132710.0008
Mysqli_queries0.580291.2447520.0112
Looping result0.00050.0783500.0000
Template Total0.593193.320.2965
Template load0.00230.369620.0012
Template processing0.590792.903820.2954
Template load and register function0.00010.017110.0001
states
state_id_array0.00090.138110.0009
state_identifier_array0.00110.174120.0006
Override
Cache load0.00210.3230530.0000
Sytem overhead
Fetch class attribute can translate value0.00080.120810.0008
Fetch class attribute name0.00130.207720.0007
XML
Image XML parsing0.00010.016810.0001
class_abstraction
Instantiating content class attribute0.00000.000920.0000
General
dbfile0.00200.3124100.0002
String conversion0.00000.002540.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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 9
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs