You are not logged in.
Pages: 1
Hi, I'm exploring BigTree CMS for couple of days and now trying to create a module which will display Staff Directory List in the front-end with the support of alphabetical navigation and pagination like the following URL:
https://www.concordiacollege.edu/direct … ces/all/1/
Taking DemoTrees module as an example I created a module along with a routed template to display Staff Directory List, this is working fine but not sure how to add alphabetical navigation and pagination functionalities in it.
Any example or a sample code will be very helpful for me. Can anyone please help me in this regards?
Offline
Okay... finally I managed to add pagination (It's defined in the BigTreeModule class) . Hope alphabetical navigation could be done in the same way.
Offline
Here's some sample methods for the module class for letter-based picking:
function getLetters() {
$available = array();
$q = sqlquery("SELECT DISTINCT(SUBSTR(last_name,1,1)) AS `letter` FROM faculty_directory");
while ($f = sqlfetch($q)) {
$available[] = strtoupper($f["letter"]);
}
sort($available);
$this->Available = array_unique($available);
$list = array();
foreach (range("A","Z") as $letter) {
$list[$letter] = in_array($letter,$available);
}
return $list;
}
function getByLetter($letter) {
$items = array();
$q = sqlquery("SELECT * FROM faculty_directory WHERE last_name LIKE '$letter%' ORDER BY `last_name` ASC, `first_name` ASC");
while ($f = sqlfetch($q)) {
$items[] = $this->get($f);
}
return $items;
}
Offline
Thanks! This is what I was looking for.
Offline
Pages: 1