gantry / gantry5

:rocket: Next Generation Template / Theme Framework
http://gantry.org
1.03k stars 205 forks source link

Content Array (Joomla) - ordering issues and questions #1624

Open JoomFX opened 7 years ago

JoomFX commented 7 years ago

Hey Matias,

I hope you had a great vacation! Now, back to work 😉

I'm opening this issue because I have 3 different issues/questions, all of them related to the article ordering in the "Content Array (Joomla)" particles (and other custom Joomla particles that are coded the same way as "Content Array"). Here we go...

Issue 1

It seems that the "Ordering" sorting method does not work properly. It works fine if only one category is selected, but if you select multiple categories, the ordering gets messed up and does not reflect the ordering that you see in the Article Manager. The same is true if you enter just the article IDs instead of selecting the whole categories. It seems that the "Ordering" sorting method considers the Category ordering as well, while, in my opinion, it should consider the article ordering only. But I'm not sure that it considers the Category order... what I know is that the ordering does not seem right.

Here, have a look at this video for more details.

Issue 2

I was wondering, how can the user sort the single articles in exactly the same order as their IDs were entered. I cannot achieve this sorting with any of the sorting methods that are currently available. I was thinking about adding a new option - User Input or Manual, but is such method already available in the API that Gantry 5 provides? I also tried to remove the ordering from the Twig so I can see if the array with article IDs is passed in exactly the same order as it was entered but it seems that it is not. Here's what I did:

// Changed this line:
{% set articles = article_finder.order(sort.orderby, sort.ordering).limit(limit.total).start(limit.start).find() %}

// To this:
{% set articles = article_finder.limit(limit.total).start(limit.start).find() %}

Issue 3

We got a request of adding the "Featured Articles Order" sorting method. Have a look at this article, you can see this sorting method in one of the screenshots close to the bottom of the page. My question is - is this sorting method already available in the Gantry 5 API and if yes, what is its name that I should use in the YAML? If it is not available in the Gantry 5 API, do you think that it makes sense to implement it? I understand that "Featured Articles Order" sorting method will be suitable ONLY when the particle is configured to show "Featured Articles Only", but still it might be a nice addition.

godweb commented 7 years ago

Hi,

regarding this issue, I have a news website where I use some particles to show the selected articles.

Not be able to establish the order of the items is a big issue that should concern all websites that use particles to present the content.

I hope someone cares soon to fix this bug

Best Regards

JoomFX commented 7 years ago

@mahagr Hey Matias,

When do you think you'll have time to look at this? I'm just asking so I know what to expect. Thanks 😉

godweb commented 7 years ago

Hi,

JoomFX explained to me that you are engaged on urgent matters, but I don't think an ordering problem is a frivolous issue.

Having a news website with articles published in random order is not the best of life, so I hope that after a long time someone can consider this bug

Thank you

JoomFX commented 7 years ago

@mahagr Hi Matias,

Please, can you just drop a quick comment here just so the other people know that you are aware of the issue.

I understand that there are more important things that need to be done first, but some people are asking me why the other issues get an official response in couple of days and at the same time there is no official response in this issue for two months.

These same people are aware of our discussion on Gitter as well.

Thanks a lot Matias and... happy holidays 😉

mahagr commented 7 years ago

1) Ordering is just a simple SQL query ORDER clause. You can do .order() multiple times to group items by category etc. Ordering isn't meant to follow same order as in admin. There's no hard coded ordering by category either. Joomla orders articles per category -- every category has item order 0.

2) If no ordering is given, database returns items on whatever order it happened to use to fetch the items. Its not bad idea to implement manual ordering...

3) You can order featured articles first by chaining ordering: .order('featured', -1').order('ordering').

PS: To find the fields you can use for ordering, just look into the SQL table.

JoomFX commented 7 years ago

Thanks for the reply Matias!

  1. I still have the feeling that the "Ordering" sorting method should work differently. I might be wrong though. Therefore, as soon as I find some free time I will do some tests and will compare how the "Ordering" sorting method works in G5 API (Particles), in Joomla itself, in RokSprocket and in the News Show SP2 module by JoomShaper. If Joomla, the RokSprocket module and the News Show SP2 module sort it differently (the same way the Articles are sorted in the Article Manager) I will come back with an update and we'll discuss it further.

  2. I see. Regarding the "Manual" ordering - please implement it when you have some time. It is a really needed feature.

  3. Thanks, but it was not about sorting the "Featured" articles first. It was about the Featured Articles Order sorting method. Anyway, leave this one. I do not think that it is important and I'll not be implementing it.

mahagr commented 7 years ago
  1. It's not really issue in the ordering() function itself, but more of how particle should chain the ordering to get the results it needs. I agree that the ordering may not be ideal for the current particles and there may be room to improve it. Or maybe I could add aliases for the most common orderings.

  2. Will need to look into it.

  3. Solving 1 would solve this one too.

JoomFX commented 7 years ago

Great! Thanks Matias!

So, to summarize:

  1. It will be awesome if you can add an alias which, when used, will show the articles in the same order as they are shown in the Article Manager (without considering the Category order). See the video from my first comment.

  2. Take your time. But manual ordering is extremely useful/needed when the particle shows single articles.

fabiosydonia commented 6 years ago

Hi, are there some news on management of "Featured Articles Order" using "Only featured article" in Gantry particle? I manage several "news website" and I frequenty use Gantry Particle News PRO (Joomla), because I find it very powerfull. But the management Featured Articles Order is indispensable for this type of portals.

A real great thank for the work that tou do. Fabio