Created
January 6, 2016 14:01
-
-
Save vojtasvoboda/b4c4a497a15f0c62e241 to your computer and use it in GitHub Desktop.
Add new Sitemap type in OctoberCMS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function boot() | |
{ | |
// Add RainLab.Blog articles to sitemap | |
Event::listen('pages.menuitem.listTypes', function() { | |
return [ | |
'blog-post' => 'Blog post', | |
'all-blog-posts' => 'All blog posts' | |
]; | |
}); | |
Event::listen('pages.menuitem.getTypeInfo', function($type) { | |
if ($type == 'blog-category' || $type == 'all-blog-categories') | |
return Category::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); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment