Two approaches - SQL or C# depending on which you feel more confident with!
SQL
Please back your database up (I really do mean that!) and then write some SQL to update the Content in the [cmsPropertyData] table.
Depending on your site and content, it could be as straight forward as using REPLACE, or you may need to use Regex to ensure you are only targeting that specific content.
C#
An alternative, would be to write a simple event handler that binds to the Publish event. On document publish, you could run a find and replace using C#, to update the content on specific properties.
With this code in place, you would then republishing all of your documents, thus triggering the event handler, and updating the content in the database.
Once you have republishing all your content, you could then remove the event handler.
Let me know if you need a hand with the code for this,
I'd considered the SQL method but not sure if I was missing an inbuilt method within the umbraco classes or maybe an add-in package that would achieve this.
I'll go ahead with the SQL approach as it seems the simplest.
Update hyperlinks in all pages programmatically.
We have a document repository outside of umbraco.
The sub-domain name of this repository is changing and I will need to update hundreds of hyperlinks in content pages.
Is there a way of doing this programmatically?
Two approaches - SQL or C# depending on which you feel more confident with!
SQL
Please back your database up (I really do mean that!) and then write some SQL to update the Content in the [cmsPropertyData] table.
Depending on your site and content, it could be as straight forward as using REPLACE, or you may need to use Regex to ensure you are only targeting that specific content.
C#
An alternative, would be to write a simple event handler that binds to the Publish event. On document publish, you could run a find and replace using C#, to update the content on specific properties.
With this code in place, you would then republishing all of your documents, thus triggering the event handler, and updating the content in the database.
Once you have republishing all your content, you could then remove the event handler.
Let me know if you need a hand with the code for this,
Cheers, Laurie
Thanks Laurence.
I'd considered the SQL method but not sure if I was missing an inbuilt method within the umbraco classes or maybe an add-in package that would achieve this.
I'll go ahead with the SQL approach as it seems the simplest.
Thanks again Andy
is working on a reply...