I would like to replace all instances of an image currently on the website with a new image but with a different name.
Example: I have a client that has 5 products in their product line that are updated with new names each year. Right now we are replacing the old style with the new style but naming the new style with the old styles' name. We are globalizing the site and things are going to get very confusing very fast - with different countries offering different models with different style names.
Is there a way to replace a current style with a new one with a different file name?
which version of Episerver are you using? And how have you currently selected that image?
I believe 9.1. Screenshot below.The image is just sitting in the Products media folder.
Let's say that the old image has the ID of 9 and the new has the ID of 10
Either you could be really extreme and change all rows in tblContentProperty where ContentLink = id of old image with the value of the new image.UPDATE tblContentProperty SET ContentLink = 10 WHERE ContentLink = 9
But normally changing the database is not really recommended if you can solve it with the API.
Here's an example of how you could do that using Episerver's API: https://github.com/alfnilsson/episerverutils/blob/master/ImageReplacer.cs