I have a view that shows the top 10 stories from (uhhh, let's think of an example site...) fruitsite.com .

Let's say there are 4 stories published to apple.fruitsite.com, 1 to orange.fruitsite.com, and 25 to the main www.fruitsite.com .

If a user is looking at apple.fruitsite.com, I'd like the list to show the 4 apple stories and then fill in the other 6 with stories from the main site. Similarly, a visitor to orange.fruitsite.com would see 1 orange story and 9 general stories.

Is there a way I can sort by current domain? I saw that I can filter by it, but I don't want my list of 10 to turn into a list of 4 (or none!) if there aren't enough stories.

Thanks!

Comments

agentrickard’s picture

You can sort by domain, but not by 'is current' first. To do that, use a views attachment.

leenwebb’s picture

Views attachment? Is this some new thing that I have not heard of before? Or do you mean, "You have to write it yourself"?

Thanks!

agentrickard’s picture

I mean, Views 2 has 'Attachment' displays, which can be attached to other displays. You would create a View filtered by current domain, and then attach one that filters by 'not current domain'.

Or, you could write a patch that does the sort you want.

leenwebb’s picture

Ooh, interesting. (I am pretty sure I will never learn all of the things that are in Views2...) Thanks for the advice!

agentrickard’s picture

Category: support » feature
Status: Active » Postponed

Attachments are great, but you'd have issues trying to get the count just right.

Marking this as a postponed feature: Allow sorting by 'is_default_domain' -- though I don't know if SQL would support that, we might need an explicit ORDERBY domain_id (4, 0, 1, 2, 3,) etc.

agentrickard’s picture

Component: - Domain Views » Code
Status: Postponed » Closed (won't fix)