Jump to content

Pages lookup, excluding already visited


Loges
 Share

Recommended Posts

Hi all,

I'm building a "news" type site and creating a "related articles" list on article pages.  That's easy enough with tags/categories fields I've setup but I'd like to exclude any articles from the list that have already been viewed by the user that session.

I can of course store the page IDs that have been viewed in a session array.

Is there a way to do this with the PW API eg $pages->find("template=articles, category=localnews, pageid!=34,56,87") or similar?

I know I can pull all pages then exclude in PHP afterwards but would rather do without the extra overhead if possible.

Thanks

Loges

Link to comment
Share on other sites

Shortest topic in history.  I keep assuming things will be more complicated than they are in PW,

The below works if anyone else is looking for the answer.

$pages->find("template=articles, category=localnews, id!=34|56|87") 

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

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

×
×
  • Create New...