Page 1 of 1

PiSearch Module returns menu_text and not content_title

Posted: Tue Jun 06, 2006 2:45 pm
by wfunderberg
Great work on the PiSearch module! However I am in desperate need of having the module return the "Title" of the content rather than the "Menu Text" (?when not  searching in News?).

The reason is because I may name a series of reports by the year in the menu due in part that they are located under a Report section "2002" would be the menu title but the page title would be "2002 Water Report".

kudos
Wes

Re: PiSearch Module returns menu_text and not content_title

Posted: Tue Jun 06, 2006 3:15 pm
by Piratos
No Problem

1.Change the first sql to this:

$sql="SELECT  c.content_id,c.content_name,c.content_alias,c.hierarchy_path,c.type,c.show_in_menu,c.menu_text,p.content FROM ".cms_db_prefix()."content c ,".cms_db_prefix()."content_props p  WHERE p.content_id = c.content_id  AND c.active = 1 AND c.type='content' AND c.show_in_menu = 1 AND p.content>''  %expage%";

2. Add this line

  $searchy[$searchi]->menutext=$dbr["menu_text"];
  $searchy[$searchi]->content_name=$dbr["content_name"];  // this is new
 
3. Add this line

  $searchy[$searchi]->menutext=$dbr["news_title"];
  $searchy[$searchi]->content_name=$dbr["news_title"];  // this is new
 
Now you have a new smarty - variable and must change the template to this.
From
{$entry->menutext}
to
{$entry->content_name}

Re: PiSearch Module returns menu_text and not content_title

Posted: Wed Jun 07, 2006 9:45 am
by wfunderberg
Thanks a lot for this! The modificiatons worked like a charm!!!!!!!!!!!! I was wondering though that could this be a request for change in the module so whenever updates come out I don't have to always modify the module?

Thanks again!

Wes