Is it possible to sort images, html and video ordered by filename?

  • Question
  • Updated 3 years ago
Hi All!

I tried searching, but I did not find any relevant answer.

I want to be able to sort the order of images, videos, etc. in a project based on name, not on type. I know I can change the order in the asset media.html, but that is to limited.

Example of project layout:
Type: Filename:
< image > 5.png
< video > 4.html
< image > 3.png
< image > 2.png
< video > 1.html

Any solution to this?

Thank you!
Photo of nleN

nle

  • 5 Posts
  • 0 Reply Likes

Posted 3 years ago

  • 3
Photo of nleN

nle

  • 5 Posts
  • 0 Reply Likes
Anyone? Im stuck at this issue. :(

It is nice to i.e have a vimeo video as number two to an image, instead of first or last.
Photo of ofisia

ofisia

  • 236 Posts
  • 21 Reply Likes
If you really need to customize the arrangement of your files, you can set it in an html file inside each of your project folders like below example.

<img src="image.jpg" alt="image">
<!-- paste Vimeo embed code here -->
<img src="another-image.jpg" alt="another image">
<!-- paste Vimeo embed code here -->
<img src="and-another-image.jpg" alt="and another image">

Best regards,
Jimmy Ofisia.
Photo of nleN

nle

  • 5 Posts
  • 0 Reply Likes
True, and thank for a solution, but I allready thought of that. :)

I was hoping for a solution, that sorted by filename not by type, by it self.
Photo of Derek Lerner

Derek Lerner

  • 2 Posts
  • 0 Reply Likes
I am attempting to accomplish the same thing, but have not yet found a solution. Loading numbered image and html files sequentially from a directory.

something like...



foreach $images or $html do
<img src="@url" alt="" width="@width" height="@height">

or @content
endforeach


or...



if (($images) || ($html)) do
<img src="@url" alt="" width="@width" height="@height"> @content
endif


Providing the ability to combine two assets in one loop? Not sure if that's the best way to describe it?

Anyone have a suggestion on how to pull this off?