Trying to make the sort option work as outlined in the docs, example 5.
Here is what I have:
<?php
$main = array(
'package' => 'extdata',
'packagePath' => '{core_path}components/extdata/model/',
'class' => 'ArtistGigs',
'fields' => 'title,venue,description,address,city,province,country,startdate,enddate',
'withFields' => 'title,venue,description,address,city,province,country,startdate,enddate',
//'sortby' => 'ArtistGigs.province DESC'
);
$joined = array();
$joined[0] = array(
'package' => 'extdata',
'packagePath' => '{core_path}components/extdata/model/',
'class' => 'ArtistAttributes',
'fields' => 'title',
'withFields' => '',
'joinCriteria' => 'ArtistAttributes.id = ArtistGigs.artistkey'
);
$joined[1] = array(
'package' => 'extdata',
'packagePath' => '{core_path}components/extdata/model/',
'class' => 'ArtistsManagers',
'fields' => '',
'withFields' => 'name,company',
'joinCriteria' => 'ArtistAttributes.id = ArtistsManagers.artistkey'
);
$andConditions = array(
'ArtistGigs.province:=' => 'province',
'ArtistGigs.genre:=' => 'genre',
'ArtistGigs.city:=' => 'city'
);
$sort = 'sort';
$qhDeclaration = array(
'qhVersion' => '1.2',
'main' => $main,
'joined' => $joined,
'andConditions' => $andConditions,
'sortby ' => $sort,
);
$hook->setQueryHook($qhDeclaration);
return true;
in the form I have a select control called 'sort'
<li class="sortby">
<label>Sort By</label>
<select name="sort">
<option></option>
<option value='province'>Province</option>
<option value='genre'>Genre</option>
<option value='city'>City</option>
<option value='dateasc'>Date ASC</option>
<option value='datedesc'>Date DESC</option>
<option value='artist'>Artist Name</option>
</select>
</li>
and the snippet call, no sortby=``
[[!AdvSearch?
&method=`post`
&tpl=`gigAdvSearchResult`
&queryHook=`AdvancedSearchGigSearch`
&containerTpl=`gigAdvSearchResults`
&showExtract=`1:content`
&extractLength=`350`
&debug=`1`
&addJQuery=`0`
no matter what I do the search always returns no results and the sortby option [as seen in the debug] is always the default 'createdon ASC' ~ well it will search by a sort field if I specify it in the snippet call, but not dynamically as I need it to & in the example.
What am I missing here?
-thanks
-sean