Wrong image path when re arranging the article structure


#1

I have a modular one page site, where the articles are set to sortable. when re arranging the articles, the folder name is changed (different number), and then the media links (custom image fields) are wrong. What is the best way to use sortable modular pages with images, so that the image url will remain correct after re arranging the articles?

Thanks


#2

Hi @hleinan, can you share the Twig code you are using for this? Might lead to some ideas…


#3

don´t need the twig code, since I can see in the admin that the image is not displaying. You can see it in the page media block, but not in the background image custom field property. When looking at the markdown file, I see that the path is the old path:


#4

The yaml:

extends@: default

form:
fields:
tabs:
type: tabs
active: 1

  fields:
    content:
      type: tab
      fields:

        header.custom.backgroundImage:
          type: file
          label: background Image
          destination: 'self@'
          multiple: false
          accept:
            - image/*

#5

I changed the destination to a predefined folder instead of @self, and that is an ok workaround. Still find it strange that the @self will get broken after re-arranging the structure. Everything else is using relative paths as far as I can tell

But it is a workaround so I can move forward.

Thanks


#6

Could it be a cache problem ?