RE: Pagination Help

2013-10-25 Thread Advantage+
On the model it's self. 
The is a field for the listings / Listings table for "featured" bool.

Pagination $params has "featured" => $featured so if the listings/featured
is passed then it would only paginate featured listings.


-Original Message-
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Anja Liebermann
Sent: Friday, October 25, 2013 8:23 AM
To: cake-php@googlegroups.com
Subject: Re: Pagination Help

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Dave,

is this condition on your first model or on a related model?


Anja


Am 16.10.2013 17:59, schrieb Advantage+:
> Now this used to work, but now it does not.. Not sure what happened.
> 
>  
> 
> I have standard pagination but offer the ability to paginate listings 
> based on "featured".
> 
>  
> 
> Paginator->options(array('url'=>
> array($this->params['pass'])));?>
> 
>  
> 
> So if "featured" was passed it would then only display featured 
> listings and paginate correct.
> 
>  
> 
> Now it just defaults back to standard (non-featured) listings. Initial 
> page of featured is fine but all the pagination links do not continue 
> to carry the listings/featured/page:xxx it goes to listings/page:xxx
> 
>  
> 
> Any insight would be great.
> 
>  
> 
> Version 2.3.8
> 
>  
> 
> Thanks,
> 
> Dave
> 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlJqTXQACgkQbOdiIJzHNKEKDQCeJmOXfPY4Y9zDs0/ogZjS5ljw
3u4An07PTuWLz1E8/iI+KluKzo1fsMU1
=Gw4r
-END PGP SIGNATURE-

--
Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter
http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Pagination Help

2013-10-25 Thread Anja Liebermann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Dave,

is this condition on your first model or on a related model?


Anja


Am 16.10.2013 17:59, schrieb Advantage+:
> Now this used to work, but now it does not.. Not sure what happened.
> 
>  
> 
> I have standard pagination but offer the ability to paginate listings based
> on "featured".
> 
>  
> 
> Paginator->options(array('url'=>
> array($this->params['pass'])));?>
> 
>  
> 
> So if "featured" was passed it would then only display featured listings and
> paginate correct.
> 
>  
> 
> Now it just defaults back to standard (non-featured) listings. Initial page
> of featured is fine but all the pagination links do not continue to carry
> the listings/featured/page:xxx it goes to listings/page:xxx
> 
>  
> 
> Any insight would be great.
> 
>  
> 
> Version 2.3.8
> 
>  
> 
> Thanks,
> 
> Dave
> 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlJqTXQACgkQbOdiIJzHNKEKDQCeJmOXfPY4Y9zDs0/ogZjS5ljw
3u4An07PTuWLz1E8/iI+KluKzo1fsMU1
=Gw4r
-END PGP SIGNATURE-

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Pagination Help

2013-10-16 Thread Advantage+
Now this used to work, but now it does not.. Not sure what happened.

 

I have standard pagination but offer the ability to paginate listings based
on "featured".

 

Paginator->options(array('url'=>
array($this->params['pass'])));?>

 

So if "featured" was passed it would then only display featured listings and
paginate correct.

 

Now it just defaults back to standard (non-featured) listings. Initial page
of featured is fine but all the pagination links do not continue to carry
the listings/featured/page:xxx it goes to listings/page:xxx

 

Any insight would be great.

 

Version 2.3.8

 

Thanks,

Dave

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


RE: Pagination Help

2009-08-11 Thread Dave Maharaj :: WidePixels.com

Perfect...the 
if ($this->RequestHandler->isAjax())
{
$this->viewPath = 'elements/users';
$this->render('pagination');
} 

Did the trick.

Thanks
Dave

-Original Message-
From: brian [mailto:bally.z...@gmail.com] 
Sent: August-11-09 3:42 PM
To: cake-php@googlegroups.com
Subject: Re: Pagination Help


If you place the markup that lists the posts in an element, you can specify
to render just that, instead of the entire view, for AJAX requests.

Here's an example that works for me.

views/users/index.ctp:

Member Directory

element('users/pagination') ?>



views/elements/users/pagination.ctp:





sort('Name', 'User.last_name',
array('title' => 'sort by last name')) ?>
sort('Organization',
'User.organization', array('title' => 'sort by organization')) ?>
sort('Country', 'User.country',
array('title'
=> 'sort by country')) ?>





element('paginator_links') ?>





...





users_controller.php:

public function index()
{
$this->set('users', $this->paginate('User'));

/* render only the element for AJAX requests
 */
if ($this->RequestHandler->isAjax())
{
$this->viewPath = 'elements/users';
$this->render('pagination');
}
}


users.js:

$(function()
{
stripeRows('#user_list tbody');
initAsyncUserPagination();
});

/**
 * Initialise AJAX requests for the users table.
 * Both the pagination and sort links will be bound so that
 * requests are made asynchronously.
 */
function initAsyncUserPagination()
{
$('#user_list .PaginationLinks a, #user_list thead
a').click(function()
{
$('#user_list').fadeTo('fast', 0.1);

$('#content').loading(true);
var href = $(this).attr('href');

/* fetch the form
 */
$.ajax({
url: href,
cache: false,
success: function(html)
{
$('#content').loading(false);

/* replace the entire #user_list table
 */

$('#user_list').replaceWith(html).fadeTo('slow', 100);
stripeRows('#user_list tbody');

/* call this function again to init new
content
 */
initAsyncUserPagination();
}
});
return false;
}); 
}

function stripeRows(selector)
{
$(selector + ' tr:nth-child(even)').addClass('Odd');
}


On Tue, Aug 11, 2009 at 1:10 PM, Dave Maharaj ::
WidePixels.com wrote:
> I have the ajax jquery pagintiion set up no problem.
>
> I am using a default layout,single column for content.
>
> Now when i load the posts page (which has the pagination) the index 
> view is split into 2 columns, right side is menu, left side is the 
> paginator. But when i click next, the 2 column loads into the pagination
div.
>
> I put just the pagination content into an element and load element 
> from the view, click next and it stll loads the full view.
>
> How can only load the pagination into a div. I know it has todo with 
> my index function because it loads the default template which then 
> pulls the index view which has the 2 cols...so when i load the ajax 
> pagination the index function is still pulling the full view.
>
> Dave
> >
>



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Pagination Help

2009-08-11 Thread brian

If you place the markup that lists the posts in an element, you can
specify to render just that, instead of the entire view, for AJAX
requests.

Here's an example that works for me.

views/users/index.ctp:

Member Directory

element('users/pagination') ?>



views/elements/users/pagination.ctp:





sort('Name', 'User.last_name', 
array('title' =>
'sort by last name')) ?>
sort('Organization', 
'User.organization',
array('title' => 'sort by organization')) ?>
sort('Country', 'User.country', 
array('title'
=> 'sort by country')) ?>





element('paginator_links') ?>





...





users_controller.php:

public function index()
{
$this->set('users', $this->paginate('User'));

/* render only the element for AJAX requests
 */
if ($this->RequestHandler->isAjax())
{
$this->viewPath = 'elements/users';
$this->render('pagination');
}
}


users.js:

$(function()
{
stripeRows('#user_list tbody');
initAsyncUserPagination();
});

/**
 * Initialise AJAX requests for the users table.
 * Both the pagination and sort links will be bound so that
 * requests are made asynchronously.
 */
function initAsyncUserPagination()
{
$('#user_list .PaginationLinks a, #user_list thead a').click(function()
{
$('#user_list').fadeTo('fast', 0.1);

$('#content').loading(true);
var href = $(this).attr('href');

/* fetch the form
 */
$.ajax({
url: href,
cache: false,
success: function(html)
{
$('#content').loading(false);

/* replace the entire #user_list table
 */

$('#user_list').replaceWith(html).fadeTo('slow', 100);
stripeRows('#user_list tbody');

/* call this function again to init new content
 */
initAsyncUserPagination();
}
});
return false;
}); 
}

function stripeRows(selector)
{
$(selector + ' tr:nth-child(even)').addClass('Odd');
}


On Tue, Aug 11, 2009 at 1:10 PM, Dave Maharaj ::
WidePixels.com wrote:
> I have the ajax jquery pagintiion set up no problem.
>
> I am using a default layout,single column for content.
>
> Now when i load the posts page (which has the pagination) the index view is
> split into 2 columns, right side is menu, left side is the paginator. But
> when i click next, the 2 column loads into the pagination div.
>
> I put just the pagination content into an element and load element from the
> view, click next and it stll loads the full view.
>
> How can only load the pagination into a div. I know it has todo with my
> index function because it loads the default template which then pulls the
> index view which has the 2 cols...so when i load the ajax pagination the
> index function is still pulling the full view.
>
> Dave
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Pagination Help

2009-08-11 Thread Dave Maharaj :: WidePixels.com
I have the ajax jquery pagintiion set up no problem.
 
I am using a default layout,single column for content.
 
Now when i load the posts page (which has the pagination) the index view is
split into 2 columns, right side is menu, left side is the paginator. But
when i click next, the 2 column loads into the pagination div.
 
I put just the pagination content into an element and load element from the
view, click next and it stll loads the full view. 
 
How can only load the pagination into a div. I know it has todo with my
index function because it loads the default template which then pulls the
index view which has the 2 cols...so when i load the ajax pagination the
index function is still pulling the full view.
 
Dave 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Pagination Help

2009-06-20 Thread Dave Maharaj :: WidePixels.com

How can I add this into the pagination?
 
In the controller:
 
foreach ($posts as $findMatches) {
  $q = $this->Post->find('first', array(
  'conditions' => array('Post.id' => $findMatches),
  
  'fields' => array(
'Post.id'),
  'contain' => array(
 'Language' => array('fields' => array('Language.id',
'Language.name')),
 'Program' => array('fields' => array('Program.id' ,
'Program.name'))
 )
  )); 


 
 $program_matches =
count(array_intersect($this->data['Program']['Program'], Set::extract($q,
'Program.{n}.id')));
 
 $language_matches =
count(array_intersect($this->data['Language']['Language'], Set::extract($q,
'Language.{n}.id')));
 
 $matches = $program_matches + $language_matches;

 $searchCount = $searchProgramCount + $searchLanguageCount;
 debug($percent = ceil(($matches/$searchCount)*100));
 
Basicaly a user does a search and I compare the search terms agints the
matches for each and get a % and I want the Posts to be ordered by matching
percentage from highest to lowest.
 
I tried 'order' => array( $percent => 'desc'), but I guess because percent
is something I made it will not find anythig to sort by.

How can I add $percent to $posts to then sort them?

Thanks,

Dave


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Pagination Help

2008-10-13 Thread jst4fun

Hi Anja, thanks for your reply. :)

On Oct 13, 11:35 am, "Liebermann, Anja Carolin"
<[EMAIL PROTECTED]> wrote:
> Hi jst4fun,
>
> I don't know one, but haven't investigated. I was just happy when mine worked 
> in the standard mode ;-)
>
> However for me this sounds as either writing your own controller action or 
> using JavaScript.
>
> Good luck!
>
> Anja
>
> -Ursprüngliche Nachricht-
> Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von 
> jst4fun
> Gesendet: Montag, 13. Oktober 2008 08:30
> An: CakePHP
> Betreff: Re:PaginationHelp
>
> Anyhelpon this issue? Thanks
>
> On Oct 10, 3:48 pm, jst4fun <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
> > I would like to have apaginationin which there wont be any numbered
> > links instead it will be a textbox with next and previous links to
> > each side of it. In the textbox the user can enter the page number to
> > be loaded and then press enter. I am not sure if such an helper exist
> > for cakephp or whether the defaultpaginationclass got that capability.
> > Is there any helper that does this, then please provide me with the
> > link or please let me know whether it is possible using the
> > currentpaginationhelper. Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



AW: Pagination Help

2008-10-12 Thread Liebermann, Anja Carolin

Hi jst4fun,

I don't know one, but haven't investigated. I was just happy when mine worked 
in the standard mode ;-)

However for me this sounds as either writing your own controller action or 
using JavaScript.

Good luck!

Anja

-Ursprüngliche Nachricht-
Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von jst4fun
Gesendet: Montag, 13. Oktober 2008 08:30
An: CakePHP
Betreff: Re: Pagination Help


Any help on this issue? Thanks

On Oct 10, 3:48 pm, jst4fun <[EMAIL PROTECTED]> wrote:
> Hi all,
> I would like to have apaginationin which there wont be any numbered 
> links instead it will be a textbox with next and previous links to 
> each side of it. In the textbox the user can enter the page number to 
> be loaded and then press enter. I am not sure if such an helper exist 
> for cakephp or whether the defaultpaginationclass got that capability. 
> Is there any helper that does this, then please provide me with the 
> link or please let me know whether it is possible using the 
> currentpaginationhelper. Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Pagination Help

2008-10-12 Thread jst4fun

Any help on this issue? Thanks

On Oct 10, 3:48 pm, jst4fun <[EMAIL PROTECTED]> wrote:
> Hi all,
> I would like to have apaginationin which there wont be any numbered
> links instead it will be a textbox with next and previous links to
> each side of it. In the textbox the user can enter the page number to
> be loaded and then press enter. I am not sure if such an helper exist
> for cakephp or whether the defaultpaginationclass got that
> capability. Is there any helper that does this, then please provide me
> with the link or please let me know whether it is possible using the
> currentpaginationhelper. Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Pagination Help

2008-10-10 Thread jst4fun

Hi all,
I tried to get an answer to my problem from the IRC but failed. Well
my issue is that I was a different king of pagination rather than the
current one. The pagination should display a textbox instead of page
numbers. This text box needs to be in between previous and next links.
The purpose is for the user to enter the page number directly to the
text box and on pressing enter key he will be taken to that page. Is
there any helper or component like that for cakephp? If not is it
possible to extend the current pagination helper in order to bring
such a functionality? Hope to get some help on this. Thanks.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Pagination Help

2008-10-10 Thread jst4fun

Hi all,
I would like to have a pagination in which there wont be any numbered
links instead it will be a textbox with next and previous links to
each side of it. In the textbox the user can enter the page number to
be loaded and then press enter. I am not sure if such an helper exist
for cakephp or whether the default pagination class got that
capability. Is there any helper that does this, then please provide me
with the link or please let me know whether it is possible using the
current pagination helper. Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: pagination help

2008-04-01 Thread Dardo Sordi Bogado

On Mon, Mar 31, 2008 at 11:44 PM, bob <[EMAIL PROTECTED]> wrote:
> I am using cake 1.2
>
> I am trying to use paginate, but the problem i am having is that my URL is
> localhost/controller/action/param1/param2
>
> so when i try to do echo $paginator->numbers(); in my view, I get the URL
> localhost/controller/action/page:2 instead of
> localhost/controller/action/param1/param2/page:2
>
> how would I do this?

Searching in this group (or in google) because this topic has been
discussed (and easily solved) many times before.

> thanks
>  >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



pagination help

2008-03-31 Thread bob
I am using cake 1.2

I am trying to use paginate, but the problem i am having is that my URL is
localhost/controller/action/param1/param2

so when i try to do echo $paginator->numbers(); in my view, I get the URL
localhost/controller/action/page:2 instead of
localhost/controller/action/param1/param2/page:2

how would I do this?

thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---