Problems, need help? Have a tip or advice? Post it here.
8 posts Page 1 of 1
Hi,

Any idea how to have the folder dropdown selector in admin for a single page to order by name?

I guess it is somewhere in the theme > sample, but I have no idea where.

See screenshot, if it is not clear, please.

Thanks,
Paolo

Attachments

Hi Paolo,

Sorry but I don't think I was able to get the problem.

Could you please rephrase the question and let me know what the use-case is (instead of the desired solution)?

Thanks.
Hi KK,

Ok, I thought it was simple.

I have a master page, with a number of virtual folders.

When I am opening a page to modify it, the dropdown doesn't show the pages in the alphabetic order, which is a little problem, as I have many folders (see attachment).

Is there a way to modify the orderby for the dropdown, and if so, in which template?

Thanks
OK, I get it now :)

The snippet rendering it is "couch/theme/_system/filter_folders.html".
You may override it by placing a copy of it within "/couch/theme/sample" folder (and activating 'sample' as the theme in couch/config.php) (more details - viewtopic.php?f=5&t=10241).

Hope this helps.
Hi KK,

Cool. I replaced <cms:folders masterpage=k_template_name hierarchical='1' orderby='title' order='asc' > in the template.

But that works only for the pad listing the folders in the folders edit view of the admin panel.

It doesn't change the pad on the individual page view for the dropdown listing the virtual folders.

Sorry to be a pain in the ass... :D
Unfortunately, that folder dropdown uses legacy code and will take some effort to change its theming.

Could you please try placing the following in your kfunctions.php and let me know if this helps?
Code: Select all
// modify sort order of folders..
    $FUNCS->add_event_listener( 'admin_pre_action', function($route){
        global $FUNCS, $PAGE;

        $masterpage='artists.php'; // use the correct name of your masterpage here

        if( $route->module=='pages' && $route->name=='edit_view' && $route->masterpage==$masterpage ){
            $PAGE->folders->set_sort( 'title', 'asc' );
            $PAGE->folders->sort( 1 );
        }
    });

IMP: Please make sure to specify the correct name of your masterpage in the code above.
Works like a charm. Editing is way easier now.

Thank you so much!

NO WAY I would have figured it out by myself. :D
You are welcome :)
8 posts Page 1 of 1