I'm trying to setup a sitemap using the craft-sitemap plugin, however it only covers sections by default and I need to add category groups into it, as half of the URLs are in categories.
I can see the Service Methods section in the docs that says that "There’s several service methods made available to add items to the sitemap."
Add a renderSitemap method to your plugin to add items via the various service methods listed below.
Here’s an example plugin hook method with comments:
addCategoryGroup(CategoryGroupModel $categoryGroup, [$changefreq, [$priority]])
Adds all categories in the group to the sitemap.
$group = craft()->categories->getGroupByHandle('news'); craft()->sitemap->addCategoryGroup($group);
But I'm not sure where to start. Where does the hook code go? As I'm assuming I'd have to create a new file, as it will need to be separate from the sitemap plugin as that will be overwritten if there are any updates.
I would appreciate some advice on this please?