I have a list page where I need to sort the lists of content in a specific way. From my Googling, it seems that I am unable to do the sorting required.
What I want to achieve is the ability to sort on four (maybe more in the future) different parameters. Since I don’t seem to be able to do this, I have created four different arrays each with a specific attribute (one that I wanted to sort on). My plan is to join the arrays together in the order (sort order) that I want them.
I am currently grappling with how I create a function to compare two arrays and only leave the values that are in neither (not union or intersect) and a function that allows me to join multiple arrays.
Would someone be able to point me in the right direction please?
I get your point. I apologise if it occurs I wasn’t being clear.
To be exact, I have many pages with different attributes. I want to be able to list all the pages but sort by multiple attributes. This is important because some pages need to be public but they are not complete (some attributes are missing), I do not want to show them at the top of the page but I want them to be on our public site. For example, some pages do not have an image, some do not have all the text required etc. Sorting by multiple attributes does not seem possible.
The way I have found that would allow me to do this is filter the pages into separate arrays (using where) that contain the missing attributes and then reconstruct one big array in a specific order:
I get the feeling I wasn’t clear enough in my last post, so I will try again.
I have approx 50 articles that I would like to present on a list page. Most articles are complete, some articles are not complete, some of them do not have a banner image.
I would like to sort the articles by:
PublishDate
whether they are complete or not
whether they have a banner image
Is it possible to sort by multiple page params or attributes of a page?