0

Hi I have a bunch of items which occur on a given day of the week. So i have a text field called Day, and it's populated by the words 'Monday', 'Tuesday', 'Wednesday' etc. Is there a way to sort this in views that will list items in Weekday order. I can only find options for alphabetical order.

2
  • You need to group, see stackoverflow.com/a/13829576
    – No Sssweat
    Apr 17, 2020 at 16:19
  • 1
    These sound like strings, so, no you can't just sort by order of days in the week. They'd have to be taxonomy at a minimum, sorted by taxonomy order.
    – Kevin
    Apr 17, 2020 at 16:29

1 Answer 1

2

This could be working for example if you'd use a taxonomy term reference instead of a text field. Just create a taxonomy with your workdays as terms.

  • use these tags on your content
  • in views add a field to show the term your content is tagged with
  • in the format options choose 'group by' and select your taxonomy field

Now the content should be grouped by the workdays. To achieve the correct sorting order you can either rely on the term-ID (which is created in chronological order) or just arrange your terms with drag and drop (in the terms dialog).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.