ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

File Manager help

September 19, 2011 11:13pm

Subscribe [2]
  • #1 / Sep 19, 2011 11:13pm

    Ryan

    31 posts

    I am outputting a file directory, each with about 5 images.

    My first dilemma was discovering {exp:file:entries} can’t orderby=“title” after I intentionally named the files sequentially.

    I’m also needing a conditional for each entry which outputs markup based on its category or maybe filename string.

    Pseudocode

    {exp:file:entries directory_id="2" limit="5" orderby="filename"}
        {file_url} / {category}
    {/exp:file:entries}

    Output: image-1.jpg (cover) / image-2.jpg (contents) / image-3.jpg (chapter 1) / image-4.jpg (chapter 2), etc.

    Any ideas?

  • #2 / Sep 20, 2011 12:03am

    Ryan

    31 posts

    I’m now able to use orderby=“title” by modifying line 306 in /system/expressionengine/modules/file/mod.file.php:

    $allowed_sorts = array('title', 'date', 'upload_date', 'random');

    I’m shocked this was so easy.

  • #3 / Sep 20, 2011 12:06am

    Ryan

    31 posts

    I’m able to return categories by using;

    {categories}{category_name}{/categories}

    I overlooked this in the documentation.

  • #4 / Sep 20, 2011 11:05am

    Mark Bowen

    12637 posts

    Hi Josephs,

    If you are adding in that ‘hack’ to the mod.file.php file then this is not something that we would be able to support should anything go wrong in the future.

    You are free to put in a Feature Request of course to have this behaviour enabled as default though. I know that the File Manager is being worked on to update it with a lot of new features. I don’t have any information as to what they are but if you put in your feature request it will be read.

    That said, is there anything else we can help with today or is it okay to close this thread now?

    Thanks,

    Mark

  • #5 / Sep 20, 2011 5:22pm

    Ryan

    31 posts

    That said, is there anything else we can help with today or is it okay to close this thread now?

    Thanks Mark, I’m aware I shouldn’t be modifying source, but this feature is essential to my project and so far I’m unaware of any other way to achieve this. Unless there is another way, then I have a solution to my problem here.

    Cheers

  • #6 / Sep 20, 2011 6:17pm

    Mark Bowen

    12637 posts

    Hi Josephs,

    As mentioned above you are quite welcome to submit a Feature Request to have this added in a future version of ExpressionEngine.

    Just remember you’ll need to apply that patch to any new versions of ExpressionEngine that you might upgrade to or you’ll likely lose that functionality.

    As you’re all set now though I’ll go ahead and close this one out.

    If anything else crops up then please don’t hesitate to post again as needed.

    Cheers,

    Mark

  • #7 / Sep 20, 2011 6:19pm

    Mark Bowen

    12637 posts

    Oops sorry. Closing now.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases