Stage to Production
Hi Team Telerik,
I am facing an unique issue of images not displaying from staging to production.
We have created the entire site on stage server.
The staging URL would be similar to: http;//stageserver.com/site1/
The production URL would be: http;//prodserver.com/
Now by this, the images referenced inside the Content Block in stage server have the URL:
/site1/default/image1.jpg
After moving the database and teh code to the production URL, the image URL remain the same i.e. "/site1/default/image1.jpg". But the actual URL should be: '/default/image1.jpg"
How do I run a script, to change the URL for production environment?
Regards,
Siddesh Kapadi
Hi Team Sitefinity,
I am sure there would be a simple solution to my quuestion. Please if I can gget to know it as the client is getting a little impatient.
Regards,
Siddesh Kapadi
Hi,
If the images in Image Widget have been broken and still refer to the inappropriate URL please use this Sitefiity API to recompile all image URLs. You should place the following source code in the Page_Load method of a new web form and request the web form in your browser. Please see the example bellow:
LibrariesManager librariesManager = LibrariesManager.GetManager();
var document = librariesManager.GetImages().Where(d => d.ApprovalWorkflowState ==
"Published"
);
foreach
(var doc
in
document)
librariesManager.RecompileItemUrls(doc);
librariesManager.SaveChanges();
HI Stefani,
Hello Siddesh,
Yes, the code should fix these images as well, since when you insert an image in a content block, the image is stored in the Image Library and the code recompiles the urls of all images in image libraries. Please take a look at the sttached image for further reference.
Kind Regards,Hi Team Telerik,
HI Team Telerik,
Any replies on this?
Hi Team telerik,