← Back to Multi-lingual SEO & Sitemap Support
I try to implement the sitemap generator to my custom module.
The SEO part seems to work smoothly, however, I have some issues with the sitemap.xml it doesn't add pages from my custom module.
My module model .php
public $implement = ['RainLab.Translate.Behaviors.TranslatableModel','Utopigs.Seo.Behaviors.SeoModel'];
public $translatable = ['title','content_short','content','additional_header','additional_content','additional'];
public $seoPageType = 'pear-pages';
public static function getMenuTypeInfo($type){ $result = []; if ($type == 'pear-pages') { $references = []; $posts = self::get(); foreach ($posts as $post) { $references[$post->id] = $post->title; } $result = [ 'references' => $references ]; } return $result; }
Plugin.php
public function boot() {
Event::listen('pages.menuitem.listTypes', function() { return [ 'pear-pages' => 'pear :: Strony', 'pear-investments' => 'pear :: Inwestycje', ]; });
Event::listen('pages.menuitem.getTypeInfo', function($type) { if ($type == 'pear-pages') return Page::getMenuTypeInfo($type); if ($type == 'pear-investments') return Investment::getMenuTypeInfo($type); });
}
It works fine in the backend I can add records from my module to the sitemap definition. When i try to generate the xml file it does not include definition from my cusotm module.
1-1 of 1