• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 2.0 URL for different states of New Post Filters

Mr Lucky

Well-known member
#1
I think this was asked maybe on the developer forum, so is gone now anyway.

I want to be able to create browser bookmarks (or links) for new posts, with and without the unread filter.

What I mean is a link that over-rides whatever the user has in his or her filter.

Can someone please tell me how to do this, thanks.
 

Mr Lucky

Well-known member
#2
I have found half the answer (I think)

If you have unread set as default, then this will over-ride it:

Code:
https://xenforo.com/community/whats-new/posts/?skip=1
But if someone's default is having unread unticked, then what would over-ride that and show only unread?

ie, is there an opposite of ?skip=1
 
Last edited:

Mike

XenForo developer
Staff member
#3
There's a generic approach to this. If you open the filters menu, right click the option you're interested in and choose "inspect" (in Chrome), the dev tools tab will highlight the <label> tag in question. Inside that, you'll see the checkbox <input> with a name and a value. You'd get params like...
  • unread=1
  • watched=1
  • participated=1
And so on.

You'd then build a URL like <url>/whats-new/posts/?unread=1&watched=1 for unread, watched only.

Similar processes can be repeated for any other what's new content type using this sort of filter.