Octobercms blog plugin has a function that Register menu items for the RainLab.Pages plugin:
public function boot()
{
/*
* Register menu items for the RainLab.Pages plugin
*/
Event::listen('pages.menuitem.listTypes', function() {
return [
'blog-category' => 'rainlab.blog::lang.menuitem.blog_category',
'all-blog-categories' => 'rainlab.blog::lang.menuitem.all_blog_categories',
'blog-post' => 'rainlab.blog::lang.menuitem.blog_post',
'all-blog-posts' => 'rainlab.blog::lang.menuitem.all_blog_posts',
'category-blog-posts' => 'rainlab.blog::lang.menuitem.category_blog_posts',
];
});
Event::listen('pages.menuitem.getTypeInfo', function($type) {
if ($type == 'blog-category' || $type == 'all-blog-categories') {
return Category::getMenuTypeInfo($type);
}
elseif ($type == 'blog-post' || $type == 'all-blog-posts' || $type == 'category-blog-posts') {
return Post::getMenuTypeInfo($type);
}
});
Event::listen('pages.menuitem.resolveItem', function($type, $item, $url, $theme) {
if ($type == 'blog-category' || $type == 'all-blog-categories') {
return Category::resolveMenuItem($item, $url, $theme);
}
elseif ($type == 'blog-post' || $type == 'all-blog-posts' || $type == 'category-blog-posts') {
return Post::resolveMenuItem($item, $url, $theme);
}
});
}
So you get for example all posts from a specific category in your frontend menu, as menu items. The problem is that there is no settings to be able to sort that post list and does not adopt the order in the backend. So i try to find a way to order those menu items generated from category posts with no success.