0

I'm trying to add a new sitemap variant using Simple XML Sitemap referenced here.

For the most part I understand it but I'm not sure where to actually place my definition and use the simple_sitemap.generator service to add it.

If I place it inside of an alter hook it never gets recognized by the site. I'm not sure how/where to add this new variant.

Thank you for your help.

0

I would have caught this question if you posted a support request ticket it in the module's issue queue.

The information in the post you are referring to is outdated. When using the newest version of the 3.x branch, you can define variants easily in the UI accessible under admin/config/search/simplesitemap/variants.

A variant is a sitemap instance of a particular sitemap type. When creating a variant, you can reference existing sitemap types or write your own by adding a sitemap type plugin which references URL and sitemap generator plugins.

Simple XML sitemap is heavily relying on the plugin architecture as opposed to hook architecture. Hence most of the time you would use the module's API service methods or write plugins inside of a custom module. There is still a couple of alter hooks remaining for convenience.

The 3.x branch has a release candidate which is very stable. You can read all about it in this blog post.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.