Get rid of "Prev" & "Next" in article: Topic is solved

General questions relating to Joomla! 5.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
SocketPup
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 130
Joined: Thu Mar 14, 2024 7:00 am

Get rid of "Prev" & "Next" in article:

Post by SocketPup » Wed Apr 24, 2024 6:58 am

Whenever I visit one of the news articles on my Joomla site, at the bottom there are links to the previous article, and the next article. This is fine, and what I want. However, after each of the links there are the words "Prev" and "Next:"
Previous article: Title of article! Prev
Previous article: Title of article! Next
I feel this is redundant and I want to get rid of those words. I use an override template for the Article, and in there is the following reference:

Code: Select all

<?php // Content is generated by content plugin event "onContentAfterDisplay" ?>
So I assume this can be customized inside the plugin "onContentAfterDisplay." Can I do an override of that too, or is there a simpler way, maybe through a setting? Where do I located "onContentAfterDisplay"?

User avatar
pe7er
Joomla! Master
Joomla! Master
Posts: 25010
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, Netherlands
Contact:

Re: Get rid of "Prev" & "Next" in article:

Post by pe7er » Wed Apr 24, 2024 7:02 am

Easier method: use a "language override" to override
JPREV="Prev"
JNEXT="Next"
with an empty ""
Kind Regards,
Peter Martin, Global Moderator
Company website: https://db8.nl/en/ - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com

SocketPup
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 130
Joined: Thu Mar 14, 2024 7:00 am

Re: Get rid of "Prev" & "Next" in article:

Post by SocketPup » Wed Apr 24, 2024 7:27 am

pe7er wrote:
Wed Apr 24, 2024 7:02 am
Easier method: use a "language override" to override
JPREV="Prev"
JNEXT="Next"
with an empty ""
Great solution, worked like a charm! Thanks.

Now, my news articles are in falling order. But when visiting any article, there is a wee problem with the "next article" and "previous article" links.
So let's say I go to the 2nd article. Now to my bottom left there is the link "previous article" and to the bottom right is "next article," as they should. The only problem is the links themselves should swap sides, so that hitting "previous article" will actually take me to the 1st article, not the 3rd as now. And vice versa.

Is there a simple way of fixing this too, or will I need to meddle inside the onContentAfterDisplay?

SharkyKZ
Joomla! Hero
Joomla! Hero
Posts: 2944
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: Get rid of "Prev" & "Next" in article:

Post by SharkyKZ » Wed Apr 24, 2024 7:43 am

Instead of mutilating language strings you should add the missing .visually-hidden class to your template. If you do want article titles to appear, go to "Content - Page Navigation" plugin and set "Link Text" option to "Title of the Article".

For the second issue, ordering is based on ordering set in the menu item. "Featured Articles Order" seems to be broken.

SocketPup
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 130
Joined: Thu Mar 14, 2024 7:00 am

Re: Get rid of "Prev" & "Next" in article:

Post by SocketPup » Wed Apr 24, 2024 4:57 pm

SharkyKZ wrote:
Wed Apr 24, 2024 7:43 am
Instead of mutilating language strings you should add the missing .visually-hidden class to your template. If you do want article titles to appear, go to "Content - Page Navigation" plugin and set "Link Text" option to "Title of the Article".
I see no "Page Navigation" under "Content." What do you mean?

SocketPup
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 130
Joined: Thu Mar 14, 2024 7:00 am

Re: Get rid of "Prev" & "Next" in article:

Post by SocketPup » Wed Apr 24, 2024 4:58 pm

SharkyKZ wrote:
Wed Apr 24, 2024 7:43 am

For the second issue, ordering is based on ordering set in the menu item. "Featured Articles Order" seems to be broken.
Ok, but shouldn't I be able to somehow access the "onContentAfterDisplay" that handles all the php code for the Next/Prev links and just switch the urls between them?

SharkyKZ
Joomla! Hero
Joomla! Hero
Posts: 2944
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: Get rid of "Prev" & "Next" in article:

Post by SharkyKZ » Wed Apr 24, 2024 7:41 pm

It's a plugin. You'll find in the Plugin Manager. It does have an layout which can be overridden. How to create overrides: https://docs.joomla.org/J4.x:Template_Overrides.

SocketPup
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 130
Joined: Thu Mar 14, 2024 7:00 am

Re: Get rid of "Prev" & "Next" in article:

Post by SocketPup » Thu Apr 25, 2024 3:03 pm

SharkyKZ wrote:
Wed Apr 24, 2024 7:41 pm
It's a plugin. You'll find in the Plugin Manager. It does have an layout which can be overridden. How to create overrides: https://docs.joomla.org/J4.x:Template_Overrides.
Found, and created an override. Thanks.


Post Reply

Return to “General Questions/New to Joomla! 5.x”