Make content block save relative path instead of absolute

Posted by laura@refactoredmedia.com on 03-Mar-2020 17:25

The content block widget saves absolute paths for images when images are selected. How do I make it select the relative path instead? We have a bunch of pages created in a pre production envt that have the pre prod domain and its time consuming to go in and have to remove the domain. V 12.2 MVC

All Replies

Posted by jread on 03-Mar-2020 17:48

How is the content moved to the production environment?  Are you accessing the same DB from pre-prod and prod?

Posted by laura@refactoredmedia.com on 03-Mar-2020 17:52

The database is cloned to become the prod db.

Posted by Ryan Kanawyer on 03-Mar-2020 18:08

If you have the documents linked through the document tool in Sitefinity then it should automatically update the url from the pre-prod to prod. I don't remember the specifics on how it works but there is a key inside of the links which is used as a reference by the system so when there is a change in the url of the document it is supposed to update the link. Of course this only works with the documents saved in the DB and only when the link is created by document link of the content block. If you used the url option and pasted the url in there manually then that is a different story and you will have to probably fix it yourself. If they documents are saved in the filesystem it should update it but you need to make sure the documents are moved into prods filesystem.

Posted by laura@refactoredmedia.com on 03-Mar-2020 18:12

Its images selected using the toolbar in the content block widget.  The domain does not update.

Posted by Ryan Kanawyer on 03-Mar-2020 18:21

Are you using Settings > Advanced > System > Site URL Settings?

Posted by laura@refactoredmedia.com on 03-Mar-2020 19:10

I am not sure what you mean by "using" but the setting "Generate Absolute Urls" is not checked

Posted by Ryan Kanawyer on 03-Mar-2020 19:16

Sorry I should have specified a little more. Is it enabled? If so, do you have the pre-prod domain added to it?

Posted by laura@refactoredmedia.com on 03-Mar-2020 19:20

Enable non-default Site URL Settings is not checked

The Host is empty

How do these effect prod vs pre/prod & how images are linked to in the content module

Thank you for your help :)

Posted by Ryan Kanawyer on 03-Mar-2020 21:53

If it was checked and host had an entry then it will affect several things (document links may be one of them). I know it messes with things such as the page preview links. Given your responses however, I am kind of stumped. Hopefully someone else has an idea on what to try next. Maybe it is a bug of some sort?

Posted by Ryan Kanawyer on 20-Mar-2020 21:27

I just found another spot which you may want to check if you have not figured this one out. Settings > Advanced > System > ServicesPaths

If that has your pre-prod environment then update it. If not then back to the drawing board. =/

This thread is closed