Hello I used {cge_file_list} to pull a list of images from my site. The image list comes back fine but I'm not sure how to sort order the list by alpha?
CMS Made Simple Install Information
CMSMS Version 2.2.5
Installed Modules
AdminSearch 1.0.4
CGExtensions 1.57.1
CGSimpleSmarty 2.1.7
CMSContentManager 1.1.6
CMSMailer 6.2.14
Captcha 0.5.5
CmsJobManager 0.1.2
DesignManager 1.1.4
FileManager 1.6.5
FilePicker 1.0.2
FormBuilder 0.8.1.6
Gallery 2.3.2
JQueryTools 1.4.0.3
MenuManager 1.50.3
MicroTiny 2.2.2
ModuleManager 2.1.3
Navigator 1.0.8
News 2.51.3
Products 2.28.3
Search 1.51.2
TinyMCE 3.2-beta3
Sorting Results of {cge_file_list}
-
- Forum Members
- Posts: 64
- Joined: Wed Jul 03, 2013 7:44 pm
Re: Sorting Results of {cge_file_list}
Have you tried
https://cmscanbesimple.org/blog/sort-array-modifier
https://cmscanbesimple.org/blog/sort-array-modifier
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: Sorting Results of {cge_file_list}
try something like:
havent' tried it, but it should work.
Code: Select all
{cge_file_list dir='foo/bar' assign='tmp'}
{@ksort($tmp)}{* no output from this *}
<select name="...">
{html_options options=$tmp selected=$something}
</select>
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
-
- Forum Members
- Posts: 64
- Joined: Wed Jul 03, 2013 7:44 pm
SOLVED Re: Sorting Results of {cge_file_list}
I added: {@ksort($filelist)} but this threw and error about the "@" symbol. I removed the "@" symbol and used the following which worked.
{cge_file_list dir='foo' pattern='*.jpg' maxdepth='1' assign='filelist'}{$sortedlist = ksort($filelist)}
{foreach $filelist as $sortedlist}
{$sortedlist}
{/foreach}
Thank you for your help!
{cge_file_list dir='foo' pattern='*.jpg' maxdepth='1' assign='filelist'}{$sortedlist = ksort($filelist)}
{foreach $filelist as $sortedlist}
{$sortedlist}
{/foreach}
Thank you for your help!