• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Sorting Results of {cge_file_list}
PostPosted: Thu Jul 12, 2018 10:16 pm 
Offline
Forum Members
Forum Members

Joined: Wed Jul 03, 2013 7:44 pm
Posts: 20
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


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Sorting Results of {cge_file_list}
PostPosted: Thu Jul 12, 2018 10:21 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Apr 23, 2008 7:53 am
Posts: 7586
Location: The Netherlands
Have you tried
https://cmscanbesimple.org/blog/sort-array-modifier

_________________
Image

Did my post help you solving a problem at your (customers) website and it saved you many hours of work? Great!! Consider buying me a cup of coffee in return! [ Click here ]



Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Sorting Results of {cge_file_list}
PostPosted: Thu Jul 12, 2018 11:11 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 7960
Location: Fernie British Columbia, Canada
try something like:
Code:
{cge_file_list dir='foo/bar' assign='tmp'}
{@ksort($tmp)}{* no output from this *}
<select name="...">
    {html_options options=$tmp selected=$something}
</select>


havent' tried it, but it should work.

_________________
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.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: SOLVED Re: Sorting Results of {cge_file_list}  Topic is solved
PostPosted: Fri Jul 13, 2018 2:32 pm 
Offline
Forum Members
Forum Members

Joined: Wed Jul 03, 2013 7:44 pm
Posts: 20
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!


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting