Hi everybody,

I have a general question about the views module:
If I sort the results by a field (in my case a date) that gets rewritten as a 'no results behavior', the sorting seems to be done before the rewrite, right?

thanks in advance,
eR

Comments

mylocaltrades’s picture

Fields are the content in which you want to show, you filter by criteria and Contextual

Offering Drupal website services to the UK - www.my-local-trades.co.uk

enochRoot’s picture

thanks for trying - but that's not related to my question.

mylocaltrades’s picture

You said you sort the results by fields, I was pointing out it is not done this way.

Can you be more specific with your question?

Offering Drupal website services to the UK - www.my-local-trades.co.uk

enochRoot’s picture

Well, under 'sort criteria' I choose (a) certain field(s), the content of which is used to establish a sorting order, right?

Now my specific scenario:

I have view, that lists nodes of (at least two) different content types.
At first only one of those content types had a field 'date', so when I choose this for sort criterion, all the nodes that don't have this field are just sorted to the bottom (or top, depends on ascending/descending).
So I added this field to the other content type as well, but I don't want the users to actually have to fill it out (btw how do hide this field in the add content form?).
Instead, I chose a 'no results behavior' that fills the empty field with a certain date (in my case the post date).
But that doesn't seem to make a difference in the sorting, so I assumed, that the views module maybe first establishes the sort order and only afterwards applies the no results behavior.

Is this the case?
And if yes, do you have any suggestions to achieve the same goal by any other means?

thanks again,
eR

enochRoot’s picture

I'd still be very interested in suggestions on how to get a view sorted by two different fields...
i.e. sort by a user-provided date or in case there is none, by post date.

desperate,
eR

commonpike’s picture

subscribing ..

*-pike