Hi,
I'm using MODx Rev 2.1.5. I'm having a problem using queryHook.
Here is my code snippet
[[!AdvSearch?
&queryHook=`testFilterHook`
&ids=`[[!GetIds? &ids=`c35`]]`
&includeTVs=`image, available, name, topics, eventTypes, fees, location`
&withTVs=`topics, eventTypes, fees, location`
&highlightTag=`strong`
&tpl=`itemTpl`
&sortby=`name`
&withFields=``
]]
The queryHook looks like
$andConditions = array(
'tv.topics:LIKE' => 'topic:request:all',
'tv.eventTypes:LIKE' => 'event:request:all',
'tv.location:LIKE' => 'location:request:all'
);
$qhDeclaration = array(
'qhVersion' => '1.1',
'andConditions' => $andConditions
);
$hook->setQueryHook($qhDeclaration);
return true;
The problem is that the TV
topics is a textArea and if the contents is not exactly the same as the request parameter sent over via the form the search doesn't work.
I need to do a LIKE search but I can't get it to work unless the string are identical. I need also the same behavior for lists.
I tried the following but to no avail. What am i doing wrong?
Thanks for your help.
$topic = strip_tags($_REQUEST['topics']);
$andConditions = array(
'tv.topics:LIKE' => '%'.$topic.'%:string',
[ed. note: eclipseTalk last edited this post 14 years, 8 months ago.]