News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Previous topic - Next topic is kinda deceiving

Started by Mick., December 31, 2021, 05:27:02 PM

Previous topic - Next topic

Mick.

I thought that when clicking on Previous topic - Next topic it would take you to just that, the topic. Instead, it takes you to the last post of such topic  :o

Diego Andrés


SMF Tricks - Free & Premium Responsive Themes for SMF.

Mick.

Quote from: Diego Andrés on December 31, 2021, 06:03:40 PMTrue, it has #new, not sure if it's intended
I looked it up in Display.php and yes, it uses #new.  Meh. lol

Mick.

I removed #new it made no sense to me. Also moved that line at the end of post and split left button to left and right button to right like I think it should be  :P

Now I'm hunting down on how to replace the language for the actual link title. I think it's way cooler than just "Previous topic" and "Next topic".

https://www.idesignsmf.com/index.php?topic=679.0

Arantor

The only downside is that you need to run 2x database queries (one for previous, one for next) and it's quite a lot of extra work on the server to do this for links that don't get clicked often in forums. (Source: we did this in Wedge. Doesn't really help users or search engines.)

Also implementing this would cause any theme that did it to fail customisation guidelines since queries shouldn't be in templates.

Mick.

Quote from: Arantor on January 01, 2022, 03:57:02 PMThe only downside is that you need to run 2x database queries (one for previous, one for next) and it's quite a lot of extra work on the server to do this for links that don't get clicked often in forums. (Source: we did this in Wedge. Doesn't really help users or search engines.)

Also implementing this would cause any theme that did it to fail customisation guidelines since queries shouldn't be in templates.

I was over my head on this. I left the "Previous topic" and "Next topic" be.

I thought by replacing $txt with ' .$context['subject']. ' would've done the trick. Nope. Wrong. lol it showed nothing. Meh... I'm happy by splitting it left and right. And yes, there is no way to achieve this from templates. I modified Display.php to suit my needs.

Advertisement: