XF 2.3 Issue with post-XXX anchor: Page scrolls to the post date in Article threads, even if it's the only post

Ferry

Active member
Hello everyone,
There is an issue with page scrolling when clicking links with the post-XXX anchor (e.g., test.com/threads/large-hadron-collider/post-3848). The problem occurs in Article threads when the post is the first and only post in the thread. In such cases, the page scrolls to the post's creation date instead of staying at the top of the page. As a result, the following elements are not visible:
  • The ad block at the top of the page,
  • The thread title,
  • The breadcrumbs.
Expected Behavior:
When clicking a link to the first/only post in an Article thread, the page should open at the very top, ensuring the ad block, thread title, and breadcrumbs are visible.
  1. How can I properly configure page scrolling for Article threads?
  2. Is there a built-in solution for this issue in XenForo?
  3. Which selectors or attributes in XenForo indicate the first/only post in Article threads?
 
Would you not just... use the standard thread link in this situation? Why would you be using the post link if you didn't want it to jump to the post? If you're using a post link, jumping to that post would be the expected behaviour. Feels like creating a problem that doesn't need to exist and already has a solution.

The post link redirects are done server-side, so you'd need an addon to check if the post is the first post in the thread and just redirect to the thread if you need it to do that for some reaosn.
 
Would you not just... use the standard thread link in this situation? Why would you be using the post link if you didn't want it to jump to the post? If you're using a post link, jumping to that post would be the expected behaviour.
On the website, there's a recent posts widget that's visible on all pages, and by default, this widget displays all posts with anchors. This isn't a problem if there are many messages in the threads; a user clicking on a link in the widget will immediately jump to the message. However, often the widget shows new closed threads that cannot be replied to, and these threads also have anchors in the widget, even if it's the only message. Consequently, when navigating to such a thread, the page appears shifted down, and elements that I intended to be in the visible area are missing.
 
Back
Top Bottom