page_list sort by custom number attribute
Permalink
is it possible in the page_list to search by a custom attribute
i am using version 5.7.2
i already tried:
i am using version 5.7.2
i already tried:
$pl->sortByAttribute('order', 'asc');
does not work!
this is the error i am getting:
An exception occurred while executing 'SELECT p.cID FROM Pages p LEFT JOIN PagePaths pp ON (p.cID = pp.cID and pp.ppIsCanonical = true) LEFT JOIN PageSearchIndex psi ON p.cID = psi.cID LEFT JOIN PageTypes pt ON p.ptID = pt.ptID INNER JOIN Collections c ON p.cID = c.cID LEFT JOIN CollectionSearchIndexAttributes csi ON c.cID = csi.cID INNER JOIN CollectionVersions cv ON p.cID = cv.cID and cvIsApproved = 1 WHERE (ak_is_featured = ?) AND (cv.pTemplateID = ?) AND (p.cPointerID < 1) AND (p.cIsTemplate = 0) AND (p.cIsActive = ?) AND (p.cIsSystemPage = ?) ORDER BY ak_event_date_time asc' with params [1, 11, true, false]: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ak_event_date_time' in 'order clause'
$pl->sortBy('csi.ak_event_date_time', 'asc');
nop! did not work. anything else?
i am trying to sort by a custom attribute with a type number with a handle "order"
so i need: $pl->sortBy('csi.order', 'asc'); like you said and it did not work.
so i need: $pl->sortBy('csi.order', 'asc'); like you said and it did not work.
my mistake forgor to put in ak_ thank you.
Try this example