Jump to content

Specify page query target with "unspecified others"


Gazley
 Share

Recommended Posts

Hi there,

Normally, I when I need to query pages by a specific category, I am quite happy for the natural returned results subject to the limit parameter, in this case limit=4

I have come across a special case where I want to specify that one item of the four equals an exact identity and that the other three values can be anything. Here is the usual case:

$albums = $pages->get('/albums/')->find("categories_selected=$page, limit=4");

This is the special case that returns a single targeted album:

$albums = $pages->get('/albums/')->children("categories_selected.name={$albumSegment}")->find("name=$albumName");

What I want is a combination of the two queries where one of the initial 4 returned values is the value of the second query. Any further paginated results should obviously exclude any of those (including the special case) in the original 4.

On first thoughts, it seems that I might need to do two queries and append the results but I thought I would ask and see if I'm missing something obvious.

Many thanks.

Link to comment
Share on other sites

You're much into albums. :P

Did you know "Alb" is ancient german myth creature that sit on your chest at night and make you have bad dreams "Albträume"?

After reading you post I have more questions than you, so I think. I might get some sleep, have to pass on this for now. :D

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...