sitemap & custom module url listing

edited May 2014 in Share
I was about to add custom module lookups to sitemap.xml (as I have in the past) when I noticed it was already showing some data from a module. I've worked out this is because the pages class uses the options_list method, and retrieves preview path urls. However, I have a 100 rows of (test) data in the module, and only a few urls are being displayed.

Secondly, another custom module with a preview path defined, just as the module above, in MY_fuel_modules, hasn't got any urls being shown, but has the same quantity of test data.

So for each case, why is this so?

I'm pretty impressed it does anything with custom modules at all, but I'd like it to work as fully as possible!

Comments

  • edited 12:59AM
    What is the preview path being used (e.g. news/{slug})? The Fuel_module::pages() method is what is used to determine the page list for a module (fuel/modules/fuel/libraries/Fuel_modules.php).
  • edited 12:59AM
    Close! news/articles/{slug}
  • edited 12:59AM
    Are the slug values different for each record and am assuming the preview_path is different between the modules correct? If you call the following in one of your view files, what gets displayed:
    $module = $this->fuel->modules->get('news'); echo '<pre>'; print_r($module->pages()); echo '</pre>'; exit();
  • edited 12:59AM
    I get a fatal error: Call to undefined method Fuel_advanced_module::pages()

    I suspect that shouldn't be the case...
  • edited June 2014
    Both modules are "advanced" types - is this a problem? If I use a "simple" module name as the param for get(), there's no error.
  • edited 12:59AM
    Yeah. The pages method only works on a simple module since they are the only ones with a preview_path. Do your advanced modules have simple modules within them? If so, you can use those module names (e.g. 'blog_posts' is a simple module within the 'blog' advanced module).
  • edited 12:59AM
    No both modules have just one model (of the same name as the module). I will just write some custom loops in sitemap like I've done before.
Sign In or Register to comment.