This topic is locked

Add search for text to list page's title

10/20/2011 9:42:38 PM
PHPRunner General questions
C
chibadl author

Hi, if it possible to add search for text to list page's title by changing template's <title>...</title>?
For example, when search "cat", list page's title will change to <title>cat ...</title>

C
cgphp 10/21/2011

In the Before display event of the List page enter this code:

if(isset($_GET['ctlSearchFor']))

{

$xt->assign("pagetitle",$_GET['ctlSearchFor']);

}
C
chibadl author 10/22/2011

Thank you so much for your help.
I pasted your code into list.php, the end of "Before display event" part, and added {pagetitle} in template's title.
But nothing appear in output page's title.
Is there anything wrong with my process?

C
cgphp 10/22/2011
{$pagetitle}



not

{pagetitle}


If AJAX search, pagination and sorting option is enabled in the Pages section this code may not work.

C
chibadl author 10/22/2011

Oh, sorry, typing mistake, I used {$pagetitle}, but no response.
As you said, sorting option is enabled in my site.
Is there any other solution or suggestion?