Problem/Motivation

Currently module doesn't provides any hooks to add custom field in sitemap.xml view source. For our case we are using coveo search so we need to add some node field inside `coveo:metadata` to SEO reason
example

<url>
  <loc>https://dxp.ddev.site/document/15516/download</loc>
  <lastmod>2017-07-08T09:05:52+01:00</lastmod>
  <changefreq>always</changefreq>
  <priority>0.5</priority>
  <coveo:metadata>
   <field_publication_date>2014-10-07T00:00Z</field_publication_date>
   <title>Modification Proposal</title>
   <field_description/>
   <field_category></field_category>
   <field_category_parent></field_category_parent>
   <field_content_classification></field_content_classification>
   <field_tags></field_tags>
  </coveo:metadata>
 </url>

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

suryabhi created an issue. See original summary.

suryabhi’s picture

Issue summary: View changes
suryabhi’s picture

Issue summary: View changes
suryabhi’s picture

Issue summary: View changes
chaitanyadessai’s picture

Status: Active » Needs review
StatusFileSize
new10.73 KB

Please review patch.

suryabhi’s picture

Hi @chaitanyadessai

Thanks for patch but its good have a pull request because most of maintainer recommend pull request

chaitanyadessai’s picture

@suryabhi Please review MR.

gbyte’s picture

Status: Needs review » Closed (won't fix)

Thanks for the code, I'm sure it will be helpful to OP. However hooks are a dying breed and it seems to me that creating a new coveoUrlGenerator plugin (OP's use case) based on entityUrlGenerator for URL generation and creating a new coveoSitemapGenerator plugin based on DefaultSitemapGenerator for presentation would be a cleaner way of doing this (albeit more code). One can then create new sitemaps and choose the new generators in the UI.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.