Articles Anywhere

Create previous / next buttons

6 months 3 days ago #88611

Tim Ziegeler's Avatar Tim Ziegeler

Hi!

I have a page that displayes a joomla article. Is it possible to create a module that shows "prev" "next" buttons where "next" would be a link to the next article of the current category (could be sorted by publish_up or ID)...

Best,
Tim

6 months 1 day ago #88617

Peter van Westen's Avatar Peter van Westen Admin

No, I don't see how Articles Anywhere could help you with that.

5 months 1 week ago #89053

Patrick Straub's Avatar Patrick Straub

Hi
It is possible with the following code:

{articles category="Blog"}
<a href="[[previous]:sefurl]">zurück</a>
<br><a href="[[next]:sefurl]">weiter</a>
{/articles}

but there are the problem, that it shows the links twice:
gamma.charivari.ch/gamma/blog/18-r%C3%BC...-colette-studer.html

is there any solution with the plugin^?

thanks
Patrick

5 months 1 week ago #89055

Peter van Westen's Avatar Peter van Westen Admin

The {articles} tag will repeat whatever you place inside the tags for every article it finds based on your filters.
So in this case you are telling it to output a zurück and weiter for every article found in the Blog category.

I am not sure what you are using to interpret the [[previous]:sefurl] syntax, as that isn't something Articles Anywhere can handle.
But you might want to look into either using the single {article} tag, or the {if first} and {if last} conditions.
See: www.regularlabs.com/extensions/articlesa...s-numbers-first-last

5 months 1 week ago #89057

Patrick Straub's Avatar Patrick Straub

hmmm - bad luck. So this will not working as well to show previous/next links inside a Article

5 months 1 week ago #89058

Peter van Westen's Avatar Peter van Westen Admin

Joomla already has a built in pagination (previous/next) thing for articles. Why not use that.

Otherwise you could try something like:

{articles category="Blog"}{if id=this:id}
<a href="[[previous]:sefurl]">zurück</a>
<br><a href="[[next]:sefurl]">weiter</a>
{/if}{/articles}

But what are you using to convert [[previous]:sefurl] to a url?

5 months 1 week ago #89064

Patrick Straub's Avatar Patrick Straub

👍 Goodness -Yes - this is woking fine now with Yootheme Builder!
Thanks a lot!

see here:
gamma.charivari.ch/gamma/blog/129-gbc2019.html