Sitemap generator |
[eluser]cmarra[/eluser]
Hello everyone, I'm trying to use Sitemap Generator http://codeigniter.com/wiki/Google% 20Sitemaps / everything works but I want to ensure that when the system enters a data in the database then I should rebuild the sitemap ... I would like to make this controller without cron script ... any ideas?
[eluser]wingdspur[/eluser]
Make sure that the page db table you are using has a last_modified field and when ever a user adds a new page or updates a page, have it call the sitemap controller method to generate a new sitemap.xml in the background. So inside the controller method for adding/updating pages, just call the sitemap controller method that generates the new XML every time there is a new page added or an update to an existing page and make sure you are updating the last_modified timestamp field as well so that the sitemap that gets generated has an updated last_modified tag in the xml file.
[eluser]cmarra[/eluser]
ok but you can call a controller in another controller? if you like?
[eluser]wingdspur[/eluser]
Well you could just move the sitemap controller method into the same controller as your page controller and then do $this->sitemap();
[eluser]InsiteFX[/eluser]
Create a MY_Controller Then extend your controllers from the MY_Controller this way you can add your site_map code to the MY_Controller and it will be avaible to all your controllers and the whole application. InsiteFX |
Welcome Guest, Not a member yet? Register Sign In |