I'd be great if you could implement something that would allow sorting in Views by filename...

My situation is that I've attached multiple images to a node, and am using Views_Slideshow to create a slideshow of the images for each particular node. I'd like to be able to sort the images to come up in the order I named them, but couldn't find a way of doing this currently.

Comments

quicksketch’s picture

Category: feature » support
Status: Active » Fixed

You can already do this. Add a relationship for the ImageField you want to sort by file name by clicking + (plus) in the relationships section, then add the relationship "Content: [Label of field] (field_[name_of_field])". Now under sorts, click + (plus) and then add a sort for File: Filename.

Anonymous’s picture

Thanks for that! It took me a while to remember what site I was talking about back then ;)
I didn't think about using relationships for sorting... only ever used them for filters.
That works well!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

rhimes’s picture

Version: 6.x-3.x-dev » 5.x-2.x-dev
Status: Closed (fixed) » Active

how would you do this in 5.x-2.x versions, views 5.x-1.x?

quicksketch’s picture

You cannot sort by filename in Views 5.x afaik. Views in Drupal 5 does not have relationships, so you're restricted to whatever sorts ImageField provided. New features will not be added to the 5.x version to add this functionality.

quicksketch’s picture

Status: Active » Closed (fixed)