activa Posted August 15, 2015 Report Posted August 15, 2015 is using the pagination helper depend in other helper/model ? i have set up it in my plugin , the page show the real item should be displayed , when i navigate manually to the next page it should the next items , so the pagination is working , but is not showing the navigation links in client side . not in client template i'm not using the WidgetClient to render the page . i use the fallowing line in the pdt file $this->Pagination->build(); Quote
Tyson Posted August 15, 2015 Report Posted August 15, 2015 is using the pagination helper depend in other helper/model ? Pagination requires the HTML helper. i have set up it in my plugin , the page show the real item should be displayed , when i navigate manually to the next page it should the next items , so the pagination is working , but is not showing the navigation links in client side . not in client template i'm not using the WidgetClient to render the page . i use the fallowing line in the pdt file $this->Pagination->build(); Calling the build method only builds pagination if you had previously set data into it from which pagination could be built, for example, the number of total results and the page you're currently on. Also, by default, pagination doesn't show if there is only one page of results. You should check the settings you have configured for pagination. Quote
Blesta Addons Posted August 15, 2015 Report Posted August 15, 2015 i get contacted by active or this subject . and i hev his code, and i see it well done the code in the controller // Overwrite default pagination settings $settings = array_merge(Configure::get("Blesta.pagination_client"), array( 'total_results' => $total_results, 'uri'=> $this->base_uri . "plugin/tarata/main/index/[p]/" , 'params'=>array('sort'=>'id','order'=>'DESC') ) ); $this->helpers(array("Pagination"=>array($this->get, $settings))); $this->Pagination->setSettings(Configure::get("Blesta.pagination_ajax")); in the template file the pagination build is well set . the pagination is working in page (page 1/ page2 ) ... the probleme the pagination is not displaying in the client view . normally if there are more than 1 page in result it should be displayed . i have made a simple test ; the total result is 6 , the displayed item per page is 4 . the page display 4 item but no pagination displayed, when i go to page 2 i see 2 result .also no pagination displayed Quote
Blesta Addons Posted August 15, 2015 Report Posted August 15, 2015 EDIT i got it working . the pagination has a option results_per_page , by default it 20 , adding this setting to the config array , fixed the issue . // Overwrite default pagination settings $settings = array_merge(Configure::get("Blesta.pagination_client"), array( 'total_results' => $total_results, 'uri'=> $this->base_uri . "plugin/tarata/main/index/[p]/" , 'results_per_page'=> 4 , 'params'=>array('sort'=>'id','order'=>'DESC') ) ); activa 1 Quote
activa Posted August 17, 2015 Author Report Posted August 17, 2015 EDIT i got it working . the pagination has a option results_per_page , by default it 20 , adding this setting to the config array , fixed the issue . // Overwrite default pagination settings $settings = array_merge(Configure::get("Blesta.pagination_client"), array( 'total_results' => $total_results, 'uri'=> $this->base_uri . "plugin/tarata/main/index/[p]/" , 'results_per_page'=> 4 , 'params'=>array('sort'=>'id','order'=>'DESC') ) ); Thanks for your help . Quote
Tyson Posted August 17, 2015 Report Posted August 17, 2015 Good to hear you got it working. The default number of results shown per page is set in the config file at 20. You can override it on a specific page by setting a new value for pagination (as you did). However, if you intend to use the default value from the config file you may want to debug why the pagination is not showing in the client UI. It should function exactly as, say, the Transactions widget's pagination. The fact it didn't appear is strange, but all of the code you shared looks fine to me, so it may be an issue caused somewhere else. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.