Welcome Guest, Not a member yet? Register   Sign In
Forum topics pagination and posts anchors
#6

(03-13-2015, 12:27 PM)hedi Wrote: I cannot imagine a way to make your example work : http://base_url/thread/{threadID}/post/{...pid{postID}

This url is a topic url showing posts (and #xxx a specific post). But if there is a pagination on that page, and it sure will be a pagination because we don't want 100 posts per topic's page, the problem is still the same.

The controller should determine which page needs to be displayed to display the requested post based on the current settings for the pager. The page shouldn't need to be passed in the URL, because the only thing that matters is that the post is displayed. For example, if the post is the 21st post in that particular thread and the pager is setup for 20 posts per page, you would display the second page. However, if the pager is changed to display 25 posts per page, you would display the first page. Since you're linking to a post, you don't reference the paging in the URL, otherwise your "perma-links" are no longer valid when the paging changes.

Quote:Sorry if i don't understand you but:

http://base_url/thread/{threadID}/post/{...pid{postID}  (your example)

or

http://example.com/forum/forum-slug/topic-slug/#5  (my example)

they are quite equals, and the pagination will break the post targeting in both cases, no?
maybe i miss something...

In my example, if postID is 5, the end of the URL is /post/5#pid5. The difference is that there is something between the last / and the #.

The post targeting might still work in your example, but it's dependent on the browser. The browser (or other tools used by the end-user) may not interpret the URL in your example properly, and it is possible that a link to http://example.com/forum/forum-slug/topic-slug/#35 would not work from the page displayed by going to http://example.com/forum/forum-slug/topic-slug/#5 (assuming the paging is setup for fewer than 30 posts per page), because the URL indicates that both posts are on the same page.
Reply


Messages In This Thread
RE: Forum topics pagination and posts anchors - by mwhitney - 03-16-2015, 12:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB