In a custom component, in the site view, I display a list of countries, each as a link to another page, displaying persons living in that country.
This is a link:
index.php?option=com_example&view=persons&country=1&Itemid=131
What's missing:
When the persons-page is opened, all persons are listed.
What I'm looking for:
I'd like to show only persons with country as in the link, 1
in the example above.
I tried to add this condition in the model-files
of persons
, but failed miserably.
+++ EDIT ++++
Thanks to the accepted answer, I was able to accomplish what I needed. Unfortunately, this seems to produce side-effects:
Fatal error: Call to a member function getPagesCounter() on a non-object
in .../view/persons/tmpl/default.php` (...)
The code throwing that error is
<?php echo $this->pagination->getPagesCounter(); ?>
When commenting out that line, the same erroer will occur with this code:
<?php echo $this->pagination->getPagesLinks(); ?>
How did that happen, and what can I do? Tried to track down that problem, but didn't know where to start.
+++ EDIT +++
Wasnm't able to solve that issue yet. Did a var_dump($this->pagination);
, this is the output:
array(1) {
[0]=>
object(stdClass)#150 (20) {
["id"]=>
string(1) "6"
["name"]=>
string(11) "Fleur Leroc"
["country"]=>
string(1) "2"
(...)
["ordering"]=>
string(1) "6"
["state"]=>
string(1) "1"
["checked_out"]=>
string(3) "615"
["checked_out_time"]=>
string(19) "2013-10-10 10:53:14"
["created_by"]=>
string(10) "Super User"
["editor"]=>
string(10) "Super User"
["countriestrainers_country_828045"]=>
string(6) "France"
["countriestrainers_flag_828045"]=>
string(28) "images/trainers/flags/fr.gif"
}
}
So the object does exist, doesn't it?