Page 1 of 1

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

Posted: Wed Apr 24, 2024 6:58 am
by SocketPup
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"?

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

Posted: Wed Apr 24, 2024 7:02 am
by pe7er
Easier method: use a "language override" to override
JPREV="Prev"
JNEXT="Next"
with an empty ""

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

Posted: Wed Apr 24, 2024 7:27 am
by SocketPup
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?

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

Posted: Wed Apr 24, 2024 7:43 am
by SharkyKZ
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.

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

Posted: Wed Apr 24, 2024 4:57 pm
by SocketPup
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?

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

Posted: Wed Apr 24, 2024 4:58 pm
by SocketPup
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?

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

Posted: Wed Apr 24, 2024 7:41 pm
by SharkyKZ
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.

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

Posted: Thu Apr 25, 2024 3:03 pm
by SocketPup
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.