Define used image style for images in sitemap

Created on 28 November 2024, 6 months ago

Problem/Motivation

Currently original image are used as images of sitemap links, which is maybe not perfect because you maybe don't want to provide them as public links or you want to have some crop/focal point based image from them in general.

For this it would be I think a nice feature if you could define an image style which is used for these images per sitemap.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany IT-Cru Munich

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @IT-Cru
  • πŸ‡©πŸ‡ͺGermany IT-Cru Munich
  • I have hereby attached the patch for adding image styles to XML Sitemaps.

  • Pipeline finished with Failed
    6 months ago
    Total: 450s
    #356691
  • Pipeline finished with Failed
    6 months ago
    Total: 335s
    #356732
  • πŸ‡ΊπŸ‡¦Ukraine Skymen

    For some reason previous patch not worked for me. I wrote updated and improved version. Please check.

  • πŸ‡©πŸ‡ͺGermany IT-Cru Munich

    @skymen: Have you tested patch file or plain diff of existing MR which in my mind should be used for further development of this feature.

    Could you maybe also provide diff of your added changes :)

  • πŸ‡ΊπŸ‡¦Ukraine Skymen

    Hi @it-cru. Sure, I have tested diff from previous MR.
    In my case (Drupal 11.1, attached media with image file to nodes) image url was generated with wrong path. As I remember, "images" was disappeared from path. Also on sitemap settings page "image style" select box was appeared dispite selection "add image in sitemap" - "No". Double conversion uri->path->uri was in previous version. So I had written the code for getting uri and return path with image style in other part of code. Maybe something else, I don't remember.
    Now almost everything work on my site
    Only one thing - I can't implement translation of the text for image link in sitemap, according to the 'title' field in media entity. As I investigated, it can't be possible without big changes of code.

Production build 0.71.5 2024