Skip to content

Add Random/Shuffle Sort Option #39

@marc-alexis-com

Description

@marc-alexis-com

I would like to request the addition of a random/shuffle sort option for the img-gallery plugin. Currently, the plugin only supports sorting by creation time (ctime), modification time (mtime), or name (name), but there's no way to display images in a random order.

Use Case

When creating inspiration galleries or showcasing collections, it would be valuable to have images displayed in a different random order each time the page is viewed. This prevents the gallery from always showing the same images first and creates a more dynamic, engaging experience.

Proposed Implementation

Add a new sortby option called random that would shuffle the images each time the gallery is rendered.

Example usage:

path: 3 RESOURCES/images/
type: horizontal
columns: 5
mobile: 2
sortby: random

Expected Behavior

  • Images would be displayed in a different random order each time the page is loaded/refreshed
  • The randomization should happen on each render, not just once
  • All other existing functionality should remain unchanged

Additional Context

This feature would be particularly useful for:

  • Inspiration galleries where variety is important
  • Photo collections where chronological order isn't meaningful
  • Any scenario where users want to discover different content each time they view the gallery

Thank you for considering this feature request! The plugin is fantastic and this would make it even more versatile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions