Skip to content

When indexing assets, use "natsort" #993

@angrybrad

Description

@angrybrad

Created by: Lindsey DiLoreto (lindsey@doublesecretagency.com) on 2015/03/11 04:48:18 +0000
Votes at time of UserVoice import: 6


I dropped a ton of images into my assets folder, then used "Update Asset Indexes" to sync them all with Craft. But when they sync with Craft, they are not sorted in a natural order:

  • my-image-1.jpg
  • my-image-10.jpg
  • my-image-11.jpg
  • my-image-2.jpg
    ...
  • my-image-8.jpg
  • my-image-9.jpg

I'd imagine that this isn't an issue most of the time. However, in this case, I'm using a script to create the proper relationships between my existing entries and the new images. Unfortunately, my import script isn't capable of arranging these files in a "natural" order, since it's just iterating over the new images.

Is it possible to have the indexing script apply a natsort filter to the list of assets before indexing them in Craft?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementimprovements to existing features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions