Page 1 of 1
[solved] How To Make Common Change among multiple pages.
Posted: Thu Nov 29, 2007 5:49 pm
by TJINAK
I need to update a url link on roughly 100 pages within my site. Is there a quick and easy way to do this?
Here is my scenrio:
Currently tag reads:
http://redoubtrealty.com/Plats,%20Subdi ... 7-6055.pdf
Tag should read:
http://redoubtrealty.com/uploads/images ... 7-6055.pdf
The name of the .pdf changes for each page.
Please see
http://redoubtrealty.com/index.php?page=07-6055 for live web site.
Thank you,
TJ
Re: How To Make Common Change among multiple pages.
Posted: Thu Nov 29, 2007 6:25 pm
by RonnyK
You could use a GCB in the future, that way you only have to change the single value in the GCB.
Ronny
Re: How To Make Common Change among multiple pages.
Posted: Thu Nov 29, 2007 6:26 pm
by calguy1000
Unfortunately there is no 'global search and replace' in CMS..... cool feature idea though.
something that allows you to select a bunch of pages, then click 'replace strings matching this regular expression with that one'..... it'd be cool.
Re: How To Make Common Change among multiple pages.
Posted: Thu Nov 29, 2007 6:38 pm
by TJINAK
Okay, so if all the content is stored in mysql is it possible to do a query (search and replace) against the correct table that holds the page content ?
I'm no MySQL guru - I'm just brain storming.
Maybe someone can help me fill in the blanks (table_name, field_name, string_to_find )...
eg:
Code: Select all
update [table_name] set [field_name] = replace([field_name],'[string_to_find]','[string_to_replace]');
Also, would this really work since I'm only wanting to replace a portion of the url, see original post.
Thank you,
TJ
Re: How To Make Common Change among multiple pages.
Posted: Thu Nov 29, 2007 6:45 pm
by calguy1000
what I would do is:
a) lock out all admin users from the site (a .htaccess file in admin can be used for this).
b) do a mysqldump of the database
c) copy that mysqldump to a backup file (for safety purposes)
d) use an editor or 'sed' to do a global search and replace inside the mysqldump
e) re-import the mysqldump
f) allow admin users to log back in. (remove the .htaccess file)
Re: How To Make Common Change among multiple pages.
Posted: Thu Nov 29, 2007 6:48 pm
by TJINAK
I like this suggestion.
I'll give it a go and report back.
TJ
Re: How To Make Common Change among multiple pages.
Posted: Thu Nov 29, 2007 9:02 pm
by TJINAK
Kudos!
604 changes in under 5 min's.
Love it!
Thank you,
TJ