Add an article sort order menu to frontend template

General questions relating to Joomla! 3.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
tristanbailey
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Sun Sep 09, 2012 12:50 am
Location: Brighton, UK
Contact:

Add an article sort order menu to frontend template

Post by tristanbailey » Mon Jul 13, 2020 8:08 pm

Hi

Have a design where they want to let the users change the sort order, newest to oldest etc, 4 different options.
So these orders are normal sql but how to add a form select on the website that changes order, then the page reload.

---
[Date - Newest first | Date - Oldest first | A-Z | Z-A]

Article title A
date: Aug 2


Article title B
date: Aug 6

---

It does not need to be ajax, just change the order and reload.
Last edited by toivo on Wed Jul 15, 2020 6:39 am, edited 1 time in total.
Reason: mod note: moved from 3.x Templates

 
User avatar
ranwilli
Joomla! Master
Joomla! Master
Posts: 19166
Joined: Sun Feb 19, 2006 6:47 pm
Location: Toledo, OH
Contact:

Re: Add an article sort order menu to frontend template

Post by ranwilli » Tue Jul 14, 2020 1:46 am

I think you'll have to build your own...

Have a look at Fabrik

I love using it, and I know you can do as you need with it.
Last edited by toivo on Tue Jul 14, 2020 5:39 am, edited 1 time in total.
Reason: mod note: changed URL to point to JED
Don't HACK the Joomla! core, Instead "Extend" and/or "Override."
Stay ON the update path.
https://harpervance.com

tristanbailey
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Sun Sep 09, 2012 12:50 am
Location: Brighton, UK
Contact:

Re: Add an article sort order menu to frontend template

Post by tristanbailey » Tue Jul 14, 2020 6:59 pm

Seems I might need to build one, just was hoping to find a similar component.

You can do column sorting on a List articles layout, so see if I can base some on that.

User avatar
sozzled
Joomla! Exemplar
Joomla! Exemplar
Posts: 9554
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Add an article sort order menu to frontend template

Post by sozzled » Tue Jul 14, 2020 7:27 pm

One way—not necessarily the "neatest" workaround—is to have four menu items:

1) Newest to oldest
2) Oldest to newest
3) Alphabetical A-Z
4) Alphabetical Z-A

Have the first menu item as the "default" in your main site menu (with the other three items hidden).

Create a module to appear on your 'blog pages—I assume that's the kind of layout you're interested in—with links to all four menu items and display the module on these pages in such a way as people will find it.

I might try this idea out myself on a test site. ;)

As you say, the list layout style has the ability to do this, if you're only interested in displaying a list of articles.
https://www.kuneze.com/blog
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 27128
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Add an article sort order menu to frontend template

Post by Per Yngve Berg » Tue Jul 14, 2020 7:46 pm

Use a split menu as the second menu module.

https://docs.joomla.org/Split_menus

User avatar
ranwilli
Joomla! Master
Joomla! Master
Posts: 19166
Joined: Sun Feb 19, 2006 6:47 pm
Location: Toledo, OH
Contact:

Re: Add an article sort order menu to frontend template

Post by ranwilli » Tue Jul 14, 2020 8:03 pm

Come on, you guys! My solution was waaaaaay harder and more complicated than those you’ve proposed.
Don't HACK the Joomla! core, Instead "Extend" and/or "Override."
Stay ON the update path.
https://harpervance.com

User avatar
sozzled
Joomla! Exemplar
Joomla! Exemplar
Posts: 9554
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Add an article sort order menu to frontend template

Post by sozzled » Tue Jul 14, 2020 8:52 pm

:laugh: @ranwilli

@tristanbailey: here's the simplest solution:

Create four menu items like I've shown in the following screenshot:
blogMenus.png
See it in operation here: https://j3xdemo.enduring.com.au/

Took me 5 minutes to put it together. ;)
You do not have the required permissions to view the files attached to this post.
https://www.kuneze.com/blog
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)

User avatar
AlexVega
Joomla! Hero
Joomla! Hero
Posts: 2518
Joined: Fri Aug 28, 2015 6:13 am
Location: México

Re: Add an article sort order menu to frontend template

Post by AlexVega » Wed Jul 15, 2020 2:58 am

sozzled wrote:
Tue Jul 14, 2020 7:27 pm
One way—not necessarily the "neatest" workaround—is to have four menu items:

1) Newest to oldest
2) Oldest to newest
3) Alphabetical A-Z
4) Alphabetical Z-A

Have the first menu item as the "default" in your main site menu (with the other three items hidden).

Create a module to appear on your 'blog pages—I assume that's the kind of layout you're interested in—with links to all four menu items and display the module on these pages in such a way as people will find it.

I might try this idea out myself on a test site. ;)

As you say, the list layout style has the ability to do this, if you're only interested in displaying a list of articles.

+ 1

Very creative, simple and ready from the core solution @sozzled.

 

Post Reply

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