Search
Other Articles Field questions
Forum

Ordering of the Fields

Elisa Foltyn's Avatar Elisa Foltyn
Hi Peter,
I have an Issue with the latest version of the articles Field. I select an Article. Afterwards I select another one.
After saving this, the fields order gets shuffled.

Can you have a look?
Thank you 🙂
Peter van Westen's Avatar Peter van Westen ADMIN
Is this also the case with the latest dev version?
regularlabs.com/development-releases
Please post a rating at the Joomla! Extensions Directory
Elisa Foltyn's Avatar Elisa Foltyn
Hi Peter, now they are displayed in the right order (without the need to resave) but the order needs still to be set to descending to have the right order in the output.
Thanks,
Elisa
Peter van Westen's Avatar Peter van Westen ADMIN
I am not sure what you mean.

The ordering of the articles - both in the select field and the frontend - are determined by the sort ordering setting in the Articles Field settings.
The 'Primary Sort Order: Ordering' option means the articles will be ordered in the way you order them in the articles list.

There is currently no option to display them in the order of selecting. And - as far as I know - there was no option for that either.
Please post a rating at the Joomla! Extensions Directory
Andrea Malalana's Avatar Andrea Malalana
There is currently no option to display them in the order of selecting. And - as far as I know - there was no option for that either.

I'm also curious about this: it would be nice if there was an option to display articles in the order in which you select them from the dropdown list.
And in such case, upon saving the input, the order of the selected values should remain as selected, without getting re-defaulted back to the order by ID.

This would allow to give a custom order based on "importance" or any other custom preference.
Peter van Westen's Avatar Peter van Westen ADMIN
The issue with this is this:

Let's say you select: B, D, A

When saving the values, they are saved in order of selecting.
And it would be no issue to show them in that order on the frontend (output of the field).

However, when showing the select field, this happens:
All the options are displayed in the select field in the order determined by the setting in the Articles Field.
The selected options get the attribute selected.
<select>
    <option value="A" selected="selected">A</option>
    <option value="B" selected="selected">B</option>
    <option value="C">C</option>
    <option value="D" selected="selected">D</option>
</select>
The selected options will just show in the order they are in the the select list.
And upon saving, that order is taken over.

This is true for all select lists, not just Articles Field.

I do not see a way to get around that.
Please post a rating at the Joomla! Extensions Directory
Elisa Foltyn's Avatar Elisa Foltyn
I don't understand. Can you explain it different?
Peter van Westen's Avatar Peter van Westen ADMIN
It comes down to this:

When the select field is shown again, the order of the selected items is reset to the order of the items in the select field.
Please post a rating at the Joomla! Extensions Directory
Elisa Foltyn's Avatar Elisa Foltyn
But why? Same does not happen to alphabetical order or reversed order? I am not sure we speak of the same thing.

My issue is following:
I select related Articles and want to show them in Frontend in the same order I selected the related Articles. Not in the Article Order because:

Example:
In an Event I want to show the speakers.
Speakers are a woman and a man.

In one event its: Ladies first. First the woman is mentioned then the man.
In the other events its two male speakers. Here I want to order the Chairman first before the other speaker.

Its not possible to do this with article ordering. It must be the ordering of the selection. I use multiselect dropdown. Not the checkboxes.
Peter van Westen's Avatar Peter van Westen ADMIN
The issue preventing this to be possible is that the select field itself (so the form field you see in the article edit form) will reset the ordering when you open the article again and save.

I can make the articles show in the frontend in the order you select them in.
But when you re-open and save the article, the order will get reset.
Please post a rating at the Joomla! Extensions Directory
Elisa Foltyn's Avatar Elisa Foltyn
I see it only in the multiselect field, checkbox does not make sense. Can#t the multiselect field retrieve the saved values instead of rearaging itself?
Peter van Westen's Avatar Peter van Westen ADMIN
But in what order do you want ALL the items in the select list to show up in? So the items in the dropdown.
And where should the selected options show up in the dropdown when you unselect it (so it goes back into the dropdown)?
Please post a rating at the Joomla! Extensions Directory
Elisa Foltyn's Avatar Elisa Foltyn
The Dropdown can always be alphabetical. I can search in the dropdown, so this order does not matter.
Peter van Westen's Avatar Peter van Westen ADMIN
Well, there is the issue. To many the ordering in the dropdown does matter. Especially when using multiple categories and grouping.

The only way I see how this could work, is if I force the selected items to be the first items in the <select> list output, and then list the rest (the Choices field will hide the selected items).
But when you then deselect an already selected item, it will go back into the dropdown at the top. Which is unexpected behavior. Again, especially if you are grouping items by category.

So I could kinda get this to work, but it is not going to be pretty when selecting > saving > deselecting items.
Please post a rating at the Joomla! Extensions Directory
Andrea Malalana's Avatar Andrea Malalana
The only way I see how this could work, is if I force the selected items to be the first items in the <select> list output, and then list the rest

Yes, this is probably the only solution, albeit with the side effects you described.

I guess you could make this happen only if in the Articles Field settings you set the "Sort Order" to "In Order of Selection", so this side effect only happens if the user specifically wants this type of ordering for the field.

In case of the Sort Order being by Title or anything else, then this behavior is not needed.
Elisa Foltyn's Avatar Elisa Foltyn
I dont mind if you group the selected fields at the top. I really only use the search box anyway. The function in the frontend is what matters...

Thank you 🙂
Peter van Westen's Avatar Peter van Westen ADMIN
Please try the latest development version from:
regularlabs.com/development-releases
Please post a rating at the Joomla! Extensions Directory
Peter van Westen's Avatar Peter van Westen ADMIN
In the Articles Field settings:
Please post a rating at the Joomla! Extensions Directory
Andrea Malalana's Avatar Andrea Malalana
I confirm this works! Very nice!
Elisa Foltyn's Avatar Elisa Foltyn
For me unfortunately the dynamic source broke for some reason, the related Articles were not listed anymore in the frontend
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription