This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Install & configuration » Writing a new search procedure....
expandshrink

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

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

Thursday 30 January 2003 1:12:37 pm - 1 reply

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.

Thursday 30 January 2003 4:26:19 pm

> 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.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from