Forums / Developer / Please look at this issue. content search module is not found.

Please look at this issue. content search module is not found.

Author Message

Romeo Antony

Wednesday 21 July 2010 1:10:10 am

Hi ,

search module in my site is not working. I have followed the entire forums replys.But no life. I am using cgi for php

I read through this forums

1. http://share.ez.no/forums/general/content_structure_and_search_module/%28from%29/ez.no/

2. http://share.ez.no/forums/install-configuration/search-error-v.4.0.1

I have changed GET to POST infollowing files for website access

extension/ezwebin/design/ezwebin/templates/content/search.tpl
extension/ezwebin/design/ezwebin/templates/content/advancedsearch.tpl

changed GET to POST infollowing files for admin interface

design\admin\templates\content\advancedsearch.tpl

design\admin\templates\content\search.tpl

But I didn't overide the search.tpl or advancedsearch.tpl.

I changed it in the same files.

Also in forums I found that, there is a need to change the GET in pagelayout.tpl in the form tag for searchbox.

I didn't found any form tag for searchbox in pagelayout(meand no Get in paglayout.tpl).I am using ez version ezpublish-4.3.0-full-with_ezc-gpl with ezflowpackage.

I have a file page_head.tpl is included pagelayout by which search is loading.

I will show it here.

page_header_searchbox.tpl is include in page_head.tpl

In page_header_searchbox.tpl , I have form tag but no get method .

So what do I do now. Can anyone please help me . I tried a lot with no success.

Also I tried the ForceVirtualHost=true in site.ini for the usersite access under sitesettings.

Romeo Antony

Wednesday 21 July 2010 5:10:18 am

Finally I have got it worked. I am explaining what I did. So people who fall into to this issue can get it up.

I have changed 3 files to get it work. changes are In

1. extension\ezwebin\design\ezwebin\templates\content\search.tpl

2. extension\ezwebin\design\ezwebin\templates\content\search.tpl

In above two files I have changed the method GET into POST.

Also I have changed an other file too. extension\ezwebin\design\ezwebin\templates\content\page_header_searchbox.tpl

in this file I didn't find a GET .

It was like this <form action={"/content/search"|ezurl}>

So by default it was GET

So to get it work I have changed from <form action={"/content/search"|ezurl}> to <form action={"/content/search"|ezurl} method="post">

Hope this help anybody in future.

Romeo

Romeo Antony

Wednesday 21 July 2010 5:12:09 am

Also do the same for admin interface , to work the defualt search in admin interface.

Gaetano Giunta

Wednesday 21 July 2010 7:32:57 am

Sorry to chime in after you worked it all out, but this is a known issue:

http://issues.ez.no/IssueView.php?Id=15150&activeItem=3

(hint: besides looking in the forums, look in the issue tracker too when you have a problem).

One other thing: you are not supposed to alter existing templates, even if they come from an extension.

What you should do is:

- in siteaccess/xxx/site.ini.append.php declare that your site has a main design that is your own, leaving the existing designs as additional ones (ie. take the current sitedesign and make it 1st of the list of additionaldesigns)

- create a new folder: design/mydesign/templates

- copy the templates you want to modify in your new design, and edit them there, eg: extension\ezwebin\design\ezwebin\templates\content\search.tpl => design\mydesign\templates\content\search.tpl

Principal Consultant International Business
Member of the Community Project Board

Romeo Antony

Wednesday 21 July 2010 3:47:30 pm

Thank you Gaetano. I wil do it.Thanks a lot for your suggestion .. Romeo

Romeo Antony

Thursday 22 July 2010 12:42:38 am

But now I have a doubt. I would like to install ezFind . My custom design is present in extension\ezflow\design\mydesign\....(all cutom design files here).

This custom design , I have put it in ezflow extension .

So in which order my extension need to be in site.ini in global override.

ActiveExtensions[]=ezfind

ActiveExtensions[]=ezwebin
ActiveExtensions[]=ezflow

Is it like these

or

ActiveExtensions[]=ezflow

ActiveExtensions[]=ezfind

ActiveExtensions[]=ezwebin

Since my default content search.tpl and default advancedsearch.tpl is inside my cutom design inside ezflow extension.

So when I install ezfind how it would be, i mean extension order.

Also, my default contentsearch is working but advancedcontentsearch.tpl is not working .it bring me a blank pag with URL http://127.0.0.1/ezpublishing/index.php?/muscatdaily/content/advancedsearch/?SearchText=oman

But advancedcontentsearch.tpl in admin perfectly working.

Please give me suggestion Thanks in advance.

Romeo Antony

Thursday 22 July 2010 12:44:01 am

Blank page link is like this

http://127.0.0.1/ezpublishing/index.php?/muscatdaily/

content/advancedsearch/?SearchText=oman

Romeo Antony

Thursday 22 July 2010 12:44:35 am

Blank page link is like this http://127.0.0.1/ezpublishing/index.php?/muscatdaily/content/advancedsearch/?SearchText=oman

Romeo Antony

Thursday 22 July 2010 12:44:51 am

http://127.0.0.1/ezpublishing/index.php?/muscatdaily/content/advancedsearch/?SearchText=oman

Gaetano Giunta

Thursday 22 July 2010 3:14:12 am

The cleanest way to store your design is not to put it in an existing extension, but in a new extension you create for your site:

extension/mysite/design/mydesign

The fact that your templates will be picked up first is not dependent on the extension where you put your design files, but rather on the fact that your design is the main one, and the other designs are fallbacks.

Assuming your main design is mydesign, the fallback one is ezwebin and the standard design is standard, and you have extensions ezwebin and myextension installed, the search order is:

  1. /extension/myext/design/mydesign/
  2. /extension/ezwebin/design/mydesign/
  3. design/mydesign/
  4. /extension/myext/design/ezwebin/
  5. /extension/ezwebin/design/ezwebin/
  6. design/ezwebin/
  7. /extension/myext/design/standard/
  8. /extension/ezwebin/design/standard/
  9. design/standard/

In fact the order of points 1/2, 4/5 and 7/8 might be swapped depending upon the order in which extensions are loaded.

This is why it is a good idea to put your templates in the mydesign design: you are sure that they will always be picked up first, regardless of the order of extensions loading.

The standard way to work with creating new templates is:

- enable debug

- look up the current template in use in the debug info, at the bottom of the page

- copy that one into your new design

- of course if you already created new templates that override serach ones, then enable ezfind later, you should check that your search templates are not missing extra functionality that would have been added by the ezfind templates

Principal Consultant International Business
Member of the Community Project Board

Romeo Antony

Thursday 22 July 2010 5:46:25 am

Gaetano, thank you for your reply and clear idea. I have one more doubt .Can you please clear me if I am wrong.

This is about advanced searching.

In search.tpl

advanced search link is like this.

{let adv_url=concat('/content/advancedsearch/',$search_text|count_chars()|gt(0)|choose('',concat('?SearchText=',$search_text|urlencode)))|ezurl}

but it will not work .

suppose i am putting some search item america in searchbox

then i will get the search result page for america.

but when I click on advanced search for the same item .

i am getting url like this with no results.

http://127.0.0.1/ezpublishing/index.php?/muscatdaily/content/advancedsearch/?SearchText=oman

But it should be like this to get the result

http://127.0.0.1/ezpublishing/index.php?/muscatdaily/content/advancedsearch/

So I have changed the code like this {let adv_url=concat('/content/advancedsearch/')|ezurl} in search.tpl to get the url http://127.0.0.1/ezpublishing/index.php?/muscatdaily/content/advancedsearch/ for advanced search .. is this wrong I am doing?

But when i do like that advanced search is properly working.

Also I found paging in searchresults is not working.

becuse when go to the 2nd page Url getting like this

http://127.0.0.1/ezpublishing/index.php?/muscatdaily/content/search/(offset)/10?SearchText=america

it should be like this http://127.0.0.1/ezpublishing/index.php?/muscatdaily/content/search/(offset)/10&SearchText=america(instead of ? it should be &)

I referred a reply from Lukasz on webpage http://share.ez.no/forums/install-configuration/search-results-and-php-in-cgi-mode-part-2

he is clearly specifying the idea to replace the ? with & using string functions.but i didin't get it. I will be tahnkfull for any help at this point .

Romeo.

Gaetano Giunta

Thursday 22 July 2010 2:32:34 pm

You are right about both: the link to advancesearch in search.tpl is broken, as well as the navigation in advancedserach.tpl

The quickest fix is to take the existing template and simply replace the '?' char with an '&' - as Vjeran did back in 2005

The correct fix is to produce a template that will work in both cgi mode and standard mode - what Lucasz suggested.

I will not give you the exact template code, but here's a pseudo code example

def $string = '/content/advancedsearch'|ezurl()

if $a contains '?' then

set $a = concat( $a , '&')

else

set $a = concat( $a , '&')

/if

set $a = concat( $a , 'Serachtext=' $searchtext)

This logic you can use both to generate the urls linking to advancedserach and the page_uri_suffix variable for including the google_navigator.tpl

Principal Consultant International Business
Member of the Community Project Board

Romeo Antony

Friday 23 July 2010 5:19:44 am

Thanks a lot .I have done it.As the same way Vjeran did it. Also I got a lot of help from him yesterday too to get it correct. thanks a lot for you and Vjeran . You people are really helpfull. Romeo.