Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
Hi! There are several folder list drop-downs present. When you create new folder you can select parent folder and corresponding dropdown lists them beautifully ordered by their weight. Same thing with folder filter drop-down in a clonnable template list view. BUT when you create a new clonnable page and select its parent folder - listing is ordered by NAME. So there is mismatch. I'm terribly sorry but I couldn't solve the problem myself as i'm not very good at php at the moment. I've found where filter folders drop-down resides but wasn't able to find the one I need(page creation view). Would really appreciate some help here :)
Hi :)

I get your point.

Could you please try the following?
Edit couch/edit-pages.php. At line no.821 you should find the following code -
// set page object
$PAGE = new KWebpage( $tpl_id, $page_id );
if( $PAGE->error ){
return $FUNCS->raise_error( ROUTE_NOT_FOUND );
}
$PAGE->set_context();

Modify it to make it as follows (the lines to be added are highlighted) -
// set page object
$PAGE = new KWebpage( $tpl_id, $page_id );
if( $PAGE->error ){
return $FUNCS->raise_error( ROUTE_NOT_FOUND );
}
$PAGE->folders->set_sort( 'weight', 'asc' );
$PAGE->folders->sort( 1 );

$PAGE->set_context();

Please test it out for sometime and let me know if works (and does not break any existing thing).

Thanks.
Thank you for helping out! I've put the sort code where you suggested and it works as expected. Couldn't find any place where it did something wrong. I can be of more help if you point where it can theoretically make things worse :)
Thanks for the confirmation.
Don't worry about the 'breaking things' part - was just being over-cautious :)
4 posts Page 1 of 1