Updating pages automatically - scripts?

Updating pages automatically - scripts?

by Tzvi Daum -
Number of replies: 2

Hi,

How can I update many pages on my Moodle site automatically? To explain, I have embedded the JW audio player with playlists on about fifty different pages, now with a new version of the player out I need to change my HTML code on all these pages. Also, for many of my pages I created a three column table with certain colors as the background and now I want to switch them all to a different color.

My question is, what is the best way to have this done automatically? I am not so familiar with the concept of scripts, but I have a feeling that might be the key. Does anyone have any more information as to what I could to for this issue?

I am using Moodle 2.5

Sincerely,

Tzvi Daum

Average of ratings: -
In reply to Tzvi Daum

Re: Updating pages automatically - scripts?

by Richard Price -

Hi Tzvi,
If the html to be replaced is the same for each instance that you wish to replace, you should be able to do a search and replace within the database.

You would need to be sure you knew what you were doing before starting and do a complete backup of your database.

There is a script builtin that is designed to replace entries of addresses for when you move servers etc, allows you to replace a string of text with another in the database.  Search_and_replace_tool . This does not ask you to confirm each change.

You could also do this for the colour of the background, by searching for the Colour code from the original and replacing with the new. But, this could cause issues if that colour is used elsewhere.

In reply to Richard Price

Re: Updating pages automatically - scripts?

by Tzvi Daum -

Hi Richard,

Thanks for reminding me about that feature. That could work in some situations. I guess the advantage of an SSI script would be you choose in advance which scripts would be updated if you only wanted to do some assuming you had different place holders. Would you happen to know if SSI scripts work with Moodle?

 

Tzvi